View Issue Details

IDProjectCategoryView StatusLast Update
0008821GNUnetcore servicepublic2024-06-08 12:03
Reporterulfvonbelow Assigned Toschanzen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86-64OSGuix SystemOS Versiona1d711c92e
Product VersionGit master 
Fixed in Version0.21.2 
Summary0008821: memory leak in gnunet-core CLI
Descriptionin run(), there are 3 exit points that fail to free keyfile
Steps To Reproduce1. Build gnunet with --enable-sanitizer
2. Run gnunet-core -s
3. Get a memory leak report
Additional InformationPatch attached.
TagsNo tags attached.
Attached Files
0001-core-fix-memory-leak-in-gnunet-core-cli.patch (917 bytes)   
From 72c6e034da12140bd70bab4c9ee20780cb6efda1 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <striness@tilde.club>
Date: Mon, 6 May 2024 16:18:00 -0500
Subject: [PATCH] core: fix memory leak in gnunet-core cli.

---
 src/cli/core/gnunet-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cli/core/gnunet-core.c b/src/cli/core/gnunet-core.c
index d351a2f7f..00b08eefc 100644
--- a/src/cli/core/gnunet-core.c
+++ b/src/cli/core/gnunet-core.c
@@ -204,14 +204,17 @@ run (void *cls,
     if (NULL == mh)
     {
       fprintf (stderr, "%s", _ ("Failed to connect to CORE service!\n"));
+      GNUNET_free (keyfile);
       return;
     }
   }
   if (! show_pid && ! show_conns && ! monitor_connections)
   {
     fprintf (stderr, "%s", _ ("No argument given.\n"));
+    GNUNET_free (keyfile);
     return;
   }
+  GNUNET_free (keyfile);
   GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
 }
 
-- 
2.41.0

Activities

schanzen

2024-05-13 10:35

administrator   ~0022383

Applied

schanzen

2024-06-08 12:03

administrator   ~0022544

0.21.2 released

Issue History

Date Modified Username Field Change
2024-05-07 07:15 ulfvonbelow New Issue
2024-05-07 07:15 ulfvonbelow File Added: 0001-core-fix-memory-leak-in-gnunet-core-cli.patch
2024-05-13 10:35 schanzen Assigned To => schanzen
2024-05-13 10:35 schanzen Status new => resolved
2024-05-13 10:35 schanzen Resolution open => fixed
2024-05-13 10:35 schanzen Fixed in Version => 0.21.2
2024-05-13 10:35 schanzen Note Added: 0022383
2024-06-08 12:03 schanzen Note Added: 0022544
2024-06-08 12:03 schanzen Status resolved => closed