The branch, master has been updated
       via  33762753f03 lib/util: Fix CID 1414760 - Resource leak
      from  11299ccee30 lib:crypto: Use gnutls_cipher_decrypt3() if possible

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 33762753f0373ec525d0351c1bcce75e68227d73
Author: Shweta Sodani <[email protected]>
Date:   Mon Sep 22 14:36:58 2025 +0530

    lib/util: Fix CID 1414760 - Resource leak
    
    If read is failed torture_assert could return without freeing the t.
    Fixing the leak.
    
    Signed-off-by: Shweta Sodani <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Vinit Agnihotri <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>
    
    Autobuild-User(master): Anoop C S <[email protected]>
    Autobuild-Date(master): Sun Sep 28 09:30:56 UTC 2025 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 lib/util/tests/tfork.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c
index 599ed7e4b52..19237a5156f 100644
--- a/lib/util/tests/tfork.c
+++ b/lib/util/tests/tfork.c
@@ -403,7 +403,7 @@ static bool test_tfork_twice(struct torture_context *tctx)
        close(up[1]);
 
        ret = read(up[0], &pid, sizeof(pid_t));
-       torture_assert(tctx, ret == sizeof(pid_t), "read failed\n");
+       torture_assert_goto(tctx, ret == sizeof(pid_t), ok, done, "read 
failed\n");
 
        status = tfork_status(&t, true);
        torture_assert_goto(tctx, status != -1, ok, done, "tfork_status 
failed\n");
@@ -413,6 +413,10 @@ static bool test_tfork_twice(struct torture_context *tctx)
        torture_assert_goto(tctx, WEXITSTATUS(status) == 0, ok, done,
                            "tfork failed\n");
 done:
+       if (t != NULL) {
+               kill(child, SIGKILL);
+               free(t);
+       }
        return ok;
 }
 


-- 
Samba Shared Repository

Reply via email to