From 018d9cce806ba96768fccec65bb6570943207c76 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Tue, 17 Mar 2015 21:19:02 -0700 Subject: [PATCH] Check vasprintf return value. --- src/gdb_packet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gdb_packet.c b/src/gdb_packet.c index fb3335e..9ce63f2 100644 --- a/src/gdb_packet.c +++ b/src/gdb_packet.c @@ -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);