From: Darren Tucker Date: Mon, 5 Aug 2019 11:36:48 +0000 (+1000) Subject: Fix mem leak in unit test. X-Git-Tag: V_8_1_P1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d46075b923bf25e6f25959a3f5b458852161cb3e;p=thirdparty%2Fopenssh-portable.git Fix mem leak in unit test. Patch from jitendra.sharma at intel.com. --- diff --git a/openbsd-compat/regress/snprintftest.c b/openbsd-compat/regress/snprintftest.c index 4ca63e180..6dc2e222a 100644 --- a/openbsd-compat/regress/snprintftest.c +++ b/openbsd-compat/regress/snprintftest.c @@ -47,7 +47,7 @@ int main(void) { char b[5]; - char *src; + char *src = NULL; snprintf(b,5,"123456789"); if (b[4] != '\0') @@ -69,5 +69,6 @@ main(void) if (x_snprintf(b, 1, "%s %d", "hello", 12345) != 11) fail("vsnprintf does not return required length"); + free(src); return failed; }