From: Volker Lendecke Date: Wed, 5 Aug 2020 09:23:30 +0000 (+0200) Subject: libcli/ldap: Fix CID 1462696 Resource leak X-Git-Tag: talloc-2.3.2~918 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de2a7574e8a0ed1fd41f707788f3e04647022dff;p=thirdparty%2Fsamba.git libcli/ldap: Fix CID 1462696 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/libcli/ldap/tests/ldap_message_test.c b/libcli/ldap/tests/ldap_message_test.c index 4ffdb3bb477..5ac7f2ef9a9 100644 --- a/libcli/ldap/tests/ldap_message_test.c +++ b/libcli/ldap/tests/ldap_message_test.c @@ -237,6 +237,7 @@ static void test_recursion_depth_greater_than_max(void **state) uint8_t *buffer = NULL; const size_t BUFF_SIZE = 1048576; size_t len; + int ret; struct ldap_request_limits limits = { .max_search_size = 256000, }; @@ -259,6 +260,10 @@ static void test_recursion_depth_greater_than_max(void **state) status = ldap_decode( asn1, &limits, samba_ldap_control_handlers(), ldap_msg); assert_ldap_status_equal(LDAP_PROTOCOL_ERROR, status); + + ret = fclose(f); + f = NULL; + assert_true(ret == 0); } /*