View Issue Details

IDProjectCategoryView StatusLast Update
0007650GNUnetfile-sharing servicepublic2024-02-29 22:46
Reporterulfvonbelow Assigned Toschanzen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.19.4Fixed in Version0.19.4 
Summary0007650: Memory leak in fs_search
DescriptionThe keywords aren't freed in GNUNET_FS_search_stop. I assume they're supposed to be. Otherwise there's a test case that isn't freeing them like it's supposed to.
Steps To Reproduce./configure --enable-sanitizer
make
make install
make check
Additional InformationPatch attached.
Tagsmemory-leak, patch
Attached Files
0001-FS-fix-memory-leak-in-GNUNET_FS_search_stop.patch (822 bytes)   
From 13a90f195441d82a8e1a37561a2b1f719059ddd9 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 07:07:51 -0600
Subject: [PATCH] FS: fix memory leak in GNUNET_FS_search_stop.

---
 src/fs/fs_search.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 823f046ed..8b8c54c67 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -1811,7 +1811,10 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
   {
     GNUNET_assert (GNUNET_FS_uri_test_ksk (sc->uri));
     for (i = 0; i < sc->uri->data.ksk.keywordCount; i++)
+    {
       GNUNET_CONTAINER_multihashmap_destroy (sc->requests[i].results);
+      GNUNET_free (sc->requests[i].keyword);
+    }
   }
   GNUNET_free (sc->requests);
   GNUNET_free (sc->emsg);
-- 
2.38.1

Activities

schanzen

2023-06-01 20:26

administrator   ~0020219

released some time ago

Issue History

Date Modified Username Field Change
2023-01-30 00:49 ulfvonbelow New Issue
2023-01-30 00:49 ulfvonbelow Tag Attached: bug
2023-01-30 00:49 ulfvonbelow Tag Attached: memory-leak
2023-01-30 00:49 ulfvonbelow Tag Attached: patch
2023-01-30 00:49 ulfvonbelow File Added: 0001-FS-fix-memory-leak-in-GNUNET_FS_search_stop.patch
2023-02-06 05:54 schanzen Assigned To => schanzen
2023-02-06 05:54 schanzen Status new => resolved
2023-02-06 05:54 schanzen Resolution open => fixed
2023-02-06 05:54 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: 0020219
2023-06-01 20:26 schanzen Status resolved => closed
2024-02-29 22:46 Christian Grothoff Tag Detached: bug