diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-05-21 15:42:30 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-05-21 15:42:30 +0000 |
commit | f6d77b2076c566a082da5b95007ea5786eaf2dc0 (patch) | |
tree | 6c25dcba7fb90d1cd898a74003afbd0b4cae3f7d /libidn/idna.c | |
parent | 48db0d69c8867d593dacf49e80a182542bc162ab (diff) | |
download | glibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.zip glibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.tar.gz glibc-f6d77b2076c566a082da5b95007ea5786eaf2dc0.tar.bz2 |
(idna_to_unicode_4z4z): Fix test for failed memory allocation.
Diffstat (limited to 'libidn/idna.c')
-rw-r--r-- | libidn/idna.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libidn/idna.c b/libidn/idna.c index 81e92f7..cf95291 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; |