aboutsummaryrefslogtreecommitdiff
path: root/libidn
diff options
context:
space:
mode:
Diffstat (limited to 'libidn')
-rw-r--r--libidn/idna.c6
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;