about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-05-21 15:42:30 +0000
committerUlrich Drepper <drepper@redhat.com>2004-05-21 15:42:30 +0000
commitf6d77b2076c566a082da5b95007ea5786eaf2dc0 (patch)
tree6c25dcba7fb90d1cd898a74003afbd0b4cae3f7d
parent48db0d69c8867d593dacf49e80a182542bc162ab (diff)
downloadglibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.tar.gz
glibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.tar.xz
glibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.zip
(idna_to_unicode_4z4z): Fix test for failed memory allocation.
-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;