Skip to content
Snippets Groups Projects
Commit c94649ef authored by deuce's avatar deuce
Browse files

Call va_end() on errors as well.

parent 462df912
No related branches found
No related tags found
No related merge requests found
......@@ -59,8 +59,10 @@ int DLLCALL vasprintf(char **strptr, const char *format, va_list va)
va_copy(va2, va);
ret = _vscprintf(format, va);
*strptr = (char *)malloc(ret+1);
if (*strptr == NULL)
if (*strptr == NULL) {
va_end(va2);
return -1;
}
ret = vsprintf(*strptr, format, va2);
va_end(va2);
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment