diff --git a/src/data-types/charconv.c b/src/data-types/charconv.c index 161f493f..596e09e8 100644 --- a/src/data-types/charconv.c +++ b/src/data-types/charconv.c @@ -173,6 +173,7 @@ int charconv(const char * tocode, const char * fromcode, res = (*extended_charconv)( tocode, fromcode, str, length, *result, &result_length); if (res != MAIL_CHARCONV_NO_ERROR) { free( *result); + *result = NULL; } else { out = realloc( *result, result_length + 1); if (out != NULL) *result = out;