__wcsconv(): free(convbuf) before returning NULL

This commit is contained in:
ache 2003-04-07 03:17:39 +00:00
parent cfb316d8d0
commit c0bef0ac8a

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);
}