Fix double free in iconvert code

This commit is contained in:
Martijn van Beurden 2023-03-17 21:55:05 +01:00
parent eba4b6f63b
commit b5c763d908
1 changed files with 2 additions and 0 deletions

View File

@ -161,6 +161,8 @@ int iconvert(const char *fromcode, const char *tocode,
/* Truncate the buffer to be tidy */
utflen = ob - utfbuf;
if (utflen == 0)
goto fail;
newbuf = realloc(utfbuf, utflen);
if (!newbuf)
goto fail;