From: Günther Deschner Date: Sat, 16 Aug 2025 14:45:15 +0000 (+0200) Subject: nsswitch/libwbclient: Fix CID #1034853 Resource leak X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a1521838a8b7a5e8f26c71c0feae415aa48abc4;p=thirdparty%2Fsamba.git nsswitch/libwbclient: Fix CID #1034853 Resource leak Guenther Signed-off-by: Guenther Deschner Reviewed-by: Anoop C S --- diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c index 01fa2892c35..0238ad69ec7 100644 --- a/nsswitch/libwbclient/tests/wbclient.c +++ b/nsswitch/libwbclient/tests/wbclient.c @@ -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)