From b2937fd6186003740f3bef3c2f4fd54a4d3cf335 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Dec 2013 20:28:04 +0100 Subject: [PATCH] Fix CID 1138341 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- ctdb/lib/replace/test/testsuite.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctdb/lib/replace/test/testsuite.c b/ctdb/lib/replace/test/testsuite.c index 52629ec82e5..387f096552f 100644 --- a/ctdb/lib/replace/test/testsuite.c +++ b/ctdb/lib/replace/test/testsuite.c @@ -266,12 +266,14 @@ static int test_strndup(void) x = strndup("bla", 2); if (strcmp(x, "bl") != 0) { printf("failure: strndup [\ninvalid\n]\n"); + free(x); return false; } free(x); x = strndup("bla", 10); if (strcmp(x, "bla") != 0) { printf("failure: strndup [\ninvalid\n]\n"); + free(x); return false; } free(x);