__wcsconv(): free(convbuf) before returning NULL

This commit is contained in:
Andrey A. Chernov 2003-04-07 03:17:39 +00:00
parent acdf797d1a
commit 6f098a4811

View File

@ -384,9 +384,11 @@ __wcsconv(wchar_t *wcsarg, int prec)
break;
mbp += clen;
}
*mbp = '\0';
if (clen == (size_t)-1)
if (clen == (size_t)-1) {
free(convbuf);
return (NULL);
}
*mbp = '\0';
return (convbuf);
}