]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nsswitch/libwbclient: Fix CID #1034853 Resource leak
authorGünther Deschner <gd@samba.org>
Sat, 16 Aug 2025 14:45:15 +0000 (16:45 +0200)
committerAnoop C S <anoopcs@samba.org>
Tue, 19 Aug 2025 08:44:30 +0000 (08:44 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
nsswitch/libwbclient/tests/wbclient.c

index 01fa2892c3533923d942bc86413399286a732869..0238ad69ec755932ad0d3f9cc33f9deb0a825e7d 100644 (file)
@@ -248,16 +248,18 @@ static bool test_wbc_guidtostring(struct torture_context *tctx)
        struct wbcGuid guid;
        const char *guid_string = "f7cf07b4-1487-45c7-824d-8b18cc580811";
        char *guid_string2;
+       bool ret = true;
 
        torture_assert_wbc_ok(tctx, wbcStringToGuid(guid_string, &guid),
                              "wbcStringToGuid of %s failed", guid_string);
        torture_assert_wbc_ok(tctx, wbcGuidToString(&guid, &guid_string2),
                              "wbcGuidToString of %s failed", guid_string);
-       torture_assert_str_equal(tctx, guid_string, guid_string2,
+       torture_assert_str_equal_goto(tctx, guid_string, guid_string2, ret, done,
                                 "guid strings differ");
+ done:
        wbcFreeMemory(guid_string2);
 
-       return true;
+       return ret;
 }
 
 static bool test_wbc_domain_info(struct torture_context *tctx)