View Issue Details

IDProjectCategoryView StatusLast Update
0007642GNUnetnamestore servicepublic2024-02-29 22:46
Reporterulfvonbelow Assigned Toschanzen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.19.4Fixed in Version0.19.4 
Summary0007642: Memory leak in parse_recordline in src/namestore/gnunet-namestore.c
DescriptionA copy (cp) of the line is leaked. Puzzlingly enough, care was taken to free it in the case of errors... but not in the case of regular operation.
Steps To Reproduce./configure --enable-sanitizer
make
make install
make check
Additional InformationPatch attached.
Tagsmemory-leak, patch
Attached Files
0001-NAMESTORE-fix-memory-leak-in-parse_recordline.patch (889 bytes)   
From abb547a78f5c3a0d41efc4b4044c563829d07244 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 06:42:56 -0600
Subject: [PATCH] NAMESTORE: fix memory leak in parse_recordline.

---
 src/namestore/gnunet-namestore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 7288db902..0329c9c63 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -464,8 +464,10 @@ parse_recordline (const char *line)
                 _ ("Invalid record data for type %s: `%s'.\n"),
                 GNUNET_GNSRECORD_number_to_typename (record.record_type),
                 tok);
+    GNUNET_free (cp);
     return GNUNET_SYSERR;
   }
+  GNUNET_free (cp);
 
   r = GNUNET_malloc (sizeof(struct RecordSetEntry) + record.data_size);
   r->next = *head;
-- 
2.38.1

Activities

schanzen

2023-06-01 20:26

administrator   ~0020226

released some time ago

Issue History

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