View Issue Details

IDProjectCategoryView StatusLast Update
0008790GNUnetGNSpublic2024-06-08 12:03
Reporterulfvonbelow Assigned Toschanzen  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
Platformx86-64OSGuix SystemOS Versiona1d711c92e
Product Version0.21.1 
Fixed in Version0.21.2 
Summary0008790: memory leak in test_gnsrecord_block_expiration
Descriptionrd[1].data is overwritten without it being freed instead of reusing tmp_data1.
Steps To Reproduce1. ./configure --enable-sanitizer ; make ; make check
2. Observe memory leak in test_gnsrecord_block_expiration
Additional Informationpatch attached
TagsNo tags attached.
Attached Files
0001-gnsrecord-fix-memory-leak-in-test_gnsrecord_block_ex.patch (1,061 bytes)   
From 603a67d6b9d688ca77443fe377d04c714a860d9f Mon Sep 17 00:00:00 2001
From: ulfvonbelow <striness@tilde.club>
Date: Thu, 2 May 2024 19:28:47 -0500
Subject: [PATCH] gnsrecord: fix memory leak in
 test_gnsrecord_block_expiration.

---
 src/lib/gnsrecord/test_gnsrecord_block_expiration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/gnsrecord/test_gnsrecord_block_expiration.c b/src/lib/gnsrecord/test_gnsrecord_block_expiration.c
index bc580954e..14b2acd97 100644
--- a/src/lib/gnsrecord/test_gnsrecord_block_expiration.c
+++ b/src/lib/gnsrecord/test_gnsrecord_block_expiration.c
@@ -83,7 +83,8 @@ run (void *cls, char *const *args, const char *cfgfile,
   rd[1].record_type = TEST_RECORD_TYPE;
   rd[1].data_size = TEST_RECORD_DATALEN;
   GNUNET_free (tmp_data1);
-  rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN);
+  tmp_data1 = GNUNET_malloc (TEST_RECORD_DATALEN);
+  rd[1].data = tmp_data1;
   rd[1].flags = GNUNET_GNSRECORD_RF_SHADOW;
   memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
 
-- 
2.41.0

Activities

schanzen

2024-05-05 14:11

administrator   ~0022345

applied

schanzen

2024-06-08 12:03

administrator   ~0022555

0.21.2 released

Issue History

Date Modified Username Field Change
2024-05-03 03:53 ulfvonbelow New Issue
2024-05-03 03:53 ulfvonbelow File Added: 0001-gnsrecord-fix-memory-leak-in-test_gnsrecord_block_ex.patch
2024-05-05 14:11 schanzen Assigned To => schanzen
2024-05-05 14:11 schanzen Status new => resolved
2024-05-05 14:11 schanzen Resolution open => fixed
2024-05-05 14:11 schanzen Fixed in Version => 0.21.2
2024-05-05 14:11 schanzen Note Added: 0022345
2024-06-08 12:03 schanzen Note Added: 0022555
2024-06-08 12:03 schanzen Status resolved => closed