From 1ac14a2d5bf3c0d2bac4647317cc3c6f74a28e8b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sat, 13 Sep 2014 18:07:07 +0200 Subject: [PATCH] intlconv: Do not free alloca-ted string --- src/intlconv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/intlconv.c b/src/intlconv.c index 46df126e..985b77f3 100644 --- a/src/intlconv.c +++ b/src/intlconv.c @@ -152,9 +152,7 @@ intlconv_utf8safestr( const char *dst_charset_id, r--; str[r++] = '\0'; res = strdup(str); - if (res == NULL) { - free(str); - } else { + if (res != NULL) { /* don't terminate string */ for (i = 0; i < r - 1; i++) if (str[i] == '\0')