[openssh-commits] [openssh] 01/01: Fix mem leak in unit test.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Aug 5 21:42:48 AEST 2019


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit d46075b923bf25e6f25959a3f5b458852161cb3e
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Mon Aug 5 21:36:48 2019 +1000

    Fix mem leak in unit test.
    
    Patch from jitendra.sharma at intel.com.
---
 openbsd-compat/regress/snprintftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openbsd-compat/regress/snprintftest.c b/openbsd-compat/regress/snprintftest.c
index 4ca63e18..6dc2e222 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;
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list