Check vasprintf return value.

This commit is contained in:
Gareth McMullin 2015-03-17 21:19:02 -07:00
parent f5f87bf70f
commit 018d9cce80
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ void gdb_outf(const char *fmt, ...)
char *buf;
va_start(ap, fmt);
vasprintf(&buf, fmt, ap);
if (vasprintf(&buf, fmt, ap) < 0)
return;
gdb_out(buf);
free(buf);
va_end(ap);