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')