From 4d66841811250814cfe5d9ca9f9371ed09901487 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 7 Oct 2016 13:35:06 +0200 Subject: [PATCH] check vasprintf return code --- i3bar/src/child.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/i3bar/src/child.c b/i3bar/src/child.c index 3570dde9..295eb76f 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -105,7 +105,9 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha char *message; va_list args; va_start(args, format); - (void)vasprintf(&message, format, args); + if (vasprintf(&message, format, args) == -1) { + return; + } struct status_block *err_block = scalloc(1, sizeof(struct status_block)); err_block->full_text = i3string_from_utf8("Error: "); -- 2.39.5