View Issue Details

IDProjectCategoryView StatusLast Update
0007642GNUnetnamestore servicepublic2024-02-29 21:46
Reporterulfvonbelow Assigned Toschanzen Due Date
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 18:26

administrator   ~0020226

released some time ago

Issue History

Date ModifiedUsernameFieldChange
2023-01-29 22:39ulfvonbelowNew Issue
2023-01-29 22:39ulfvonbelowTag Attached: bug
2023-01-29 22:39ulfvonbelowTag Attached: memory-leak
2023-01-29 22:39ulfvonbelowTag Attached: patch
2023-01-29 22:39ulfvonbelowFile Added: 0001-NAMESTORE-fix-memory-leak-in-parse_recordline.patch
2023-02-06 05:02schanzenAssigned To => schanzen
2023-02-06 05:02schanzenStatusnew => resolved
2023-02-06 05:02schanzenResolutionopen => fixed
2023-02-06 05:02schanzenFixed in Version => 0.19.4
2023-02-06 05:19schanzenTarget Version => 0.19.4
2023-06-01 18:26schanzenNote Added: 0020226
2023-06-01 18:26schanzenStatusresolved => closed
2024-02-29 21:46Christian GrothoffTag Detached: bug