]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: avoid possible va_args leak
authorOrestis Floros <orestisf1993@gmail.com>
Tue, 26 Sep 2017 09:29:40 +0000 (12:29 +0300)
committerOrestis Floros <orestisf1993@gmail.com>
Tue, 17 Oct 2017 01:28:07 +0000 (04:28 +0300)
i3bar/src/child.c

index fe989c44c25a639c8f51e6f8589d2fa787db8abd..170fcdefc538eddf57ce2c9899c39edc89a3fd1b 100644 (file)
@@ -106,7 +106,7 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha
     va_list args;
     va_start(args, format);
     if (vasprintf(&message, format, args) == -1) {
-        return;
+        goto finish;
     }
 
     struct status_block *err_block = scalloc(1, sizeof(struct status_block));
@@ -124,6 +124,7 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha
     TAILQ_INSERT_HEAD(&statusline_head, err_block, blocks);
     TAILQ_INSERT_TAIL(&statusline_head, message_block, blocks);
 
+finish:
     FREE(message);
     va_end(args);
 }