From: Florian Forster Date: Thu, 16 Jul 2020 09:40:05 +0000 (+0200) Subject: src/utils/cmds/cmds_test.c: Free memory allocated in the string buffer. X-Git-Tag: 6.0.0-rc0~144^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac5edc69aff0385836557b779d703a44dddb2016;p=thirdparty%2Fcollectd.git src/utils/cmds/cmds_test.c: Free memory allocated in the string buffer. --- diff --git a/src/utils/cmds/cmds_test.c b/src/utils/cmds/cmds_test.c index 7b26b570b..842c9e812 100644 --- a/src/utils/cmds/cmds_test.c +++ b/src/utils/cmds/cmds_test.c @@ -52,7 +52,7 @@ static void error_cb(void *ud, cmd_status_t status, const char *format, int size = vsnprintf(NULL, 0, format, ap_copy); assert(size > 0); - char buffer[size+1]; + char buffer[size + 1]; vsnprintf(buffer, sizeof(buffer), format, ap); strbuf_print(buf, buffer); @@ -402,6 +402,7 @@ DEF_TEST(parse) { test_result = -1; cmd_destroy(&cmd); + STRBUF_DESTROY(errbuf); free(input); }