View Issue Details

IDProjectCategoryView StatusLast Update
0007631GNUnetsecret sharing servicepublic2023-06-01 18:26
Reporterulfvonbelow Assigned ToFlorian Dold Due Date
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
Attached Files
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

Activities

schanzen

2023-06-01 18:26

administrator   ~0020236

released some time ago

Issue History

Date ModifiedUsernameFieldChange
2023-01-29 21:33ulfvonbelowNew Issue
2023-01-29 21:33ulfvonbelowStatusnew => assigned
2023-01-29 21:33ulfvonbelowAssigned To => Florian Dold
2023-01-29 21:33ulfvonbelowTag Attached: memory-leak
2023-01-29 21:33ulfvonbelowTag Attached: patch
2023-01-29 21:33ulfvonbelowFile Added: 0001-SECRETSHARING-don-t-leak-my_share-in-test.patch
2023-02-06 05:16schanzenStatusassigned => resolved
2023-02-06 05:16schanzenResolutionopen => fixed
2023-02-06 05:16schanzenFixed in Version => 0.19.4
2023-02-06 05:19schanzenTarget Version => 0.19.4
2023-06-01 18:26schanzenNote Added: 0020236
2023-06-01 18:26schanzenStatusresolved => closed