about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--libidn/idna.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libidn/idna.c b/libidn/idna.c
index 81e92f7d06..cf95291596 100644
--- a/libidn/idna.c
+++ b/libidn/idna.c
@@ -115,9 +115,11 @@ idna_to_ascii_4i (const uint32_t * in, size_t inlen, char *out, int flags)
     len = strlen (p);
     do
       {
+	char *newp;
+
 	len = 2 * len + 10;	/* XXX better guess? */
-	char *newp = realloc (p, len);
-	if (p == NULL)
+	newp = realloc (p, len);
+	if (newp == NULL)
 	  {
 	    free (p);
 	    return IDNA_MALLOC_ERROR;