View Issue Details

IDProjectCategoryView StatusLast Update
0007631GNUnetsecret sharing servicepublic2023-06-01 20:26
Reporterulfvonbelow Assigned ToFlorian Dold  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.19.4Fixed in Version0.19.4 
Summary0007631: Memory leak in secretsharing test
DescriptionMy understanding is that it's the callback's responsibility to manage the lifetime of the passed share, but in secret_ready_cb in src/secretsharing/test_secretsharing_api.c it just lets it leak.
Steps To Reproduce./configure --enable-sanitizer
make
make install
make check
Additional InformationPatch attached.
Tagsmemory-leak, patch

Activities

ulfvonbelow

2023-01-29 22:33

reporter  

0001-SECRETSHARING-don-t-leak-my_share-in-test.patch (858 bytes)   
From 6bbaeffb7079a2503dcf42ee5f8c7ca391b6c4c4 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 05:57:47 -0600
Subject: [PATCH] -SECRETSHARING: don't leak my_share in test.

---
 src/secretsharing/test_secretsharing_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/secretsharing/test_secretsharing_api.c b/src/secretsharing/test_secretsharing_api.c
index 227af1c3e..470bfddf4 100644
--- a/src/secretsharing/test_secretsharing_api.c
+++ b/src/secretsharing/test_secretsharing_api.c
@@ -45,6 +45,7 @@ secret_ready_cb (void *cls,
     success = 1;
   // FIXME: check that our share is valid, which we can do as there's only
   // one peer.
+  GNUNET_SECRETSHARING_share_destroy (my_share);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "secret ready, shutting down\n");
   GNUNET_SCHEDULER_shutdown ();
 }
-- 
2.38.1

schanzen

2023-06-01 20:26

administrator   ~0020236

released some time ago

Issue History

Date Modified Username Field Change
2023-01-29 22:33 ulfvonbelow New Issue
2023-01-29 22:33 ulfvonbelow Status new => assigned
2023-01-29 22:33 ulfvonbelow Assigned To => Florian Dold
2023-01-29 22:33 ulfvonbelow Tag Attached: memory-leak
2023-01-29 22:33 ulfvonbelow Tag Attached: patch
2023-01-29 22:33 ulfvonbelow File Added: 0001-SECRETSHARING-don-t-leak-my_share-in-test.patch
2023-02-06 06:16 schanzen Status assigned => resolved
2023-02-06 06:16 schanzen Resolution open => fixed
2023-02-06 06:16 schanzen Fixed in Version => 0.19.4
2023-02-06 06:19 schanzen Target Version => 0.19.4
2023-06-01 20:26 schanzen Note Added: 0020236
2023-06-01 20:26 schanzen Status resolved => closed