View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007643 | GNUnet | namestore service | public | 2023-01-29 23:39 | 2023-06-01 20:26 |
Reporter | ulfvonbelow | Assigned To | schanzen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Git master | ||||
Target Version | 0.19.4 | Fixed in Version | 0.19.4 | ||
Summary | 0007643: Memory leaks in namestore tests | ||||
Description | plugin_name isn't freed in a lot of these. And in lookup_success in test_namestore_api_store_update.c, rd_new.data isn't freed. | ||||
Steps To Reproduce | ./configure --enable-sanitizer make make install make check | ||||
Additional Information | Patch attached. | ||||
Tags | memory-leak, patch | ||||
|
0001-NAMESTORE-fix-memory-leaks-in-tests.patch (10,831 bytes)
From 347a183b280b250b5adb4469ca12f014ce08d9ad Mon Sep 17 00:00:00 2001 From: ulfvonbelow <strilen@tilde.club> Date: Sun, 29 Jan 2023 06:46:57 -0600 Subject: [PATCH] -NAMESTORE: fix memory leaks in tests. This allows us to use sanitizers to find bugs that matter. --- src/namestore/perf_namestore_api_import.c | 1 + src/namestore/perf_namestore_api_zone_iteration.c | 1 + src/namestore/test_common.c | 2 ++ src/namestore/test_namestore_api_edit_records.c | 1 + src/namestore/test_namestore_api_lookup_nick.c | 1 + src/namestore/test_namestore_api_monitoring.c | 1 + src/namestore/test_namestore_api_monitoring_existing.c | 1 + src/namestore/test_namestore_api_remove.c | 1 + src/namestore/test_namestore_api_remove_not_existing_record.c | 1 + src/namestore/test_namestore_api_store.c | 1 + src/namestore/test_namestore_api_store_update.c | 2 ++ src/namestore/test_namestore_api_tx_rollback.c | 1 + src/namestore/test_namestore_api_zone_iteration.c | 1 + src/namestore/test_namestore_api_zone_iteration_nick.c | 1 + src/namestore/test_namestore_api_zone_iteration_specific_zone.c | 1 + src/namestore/test_namestore_api_zone_iteration_stop.c | 1 + src/namestore/test_namestore_api_zone_to_name.c | 1 + 17 files changed, 19 insertions(+) diff --git a/src/namestore/perf_namestore_api_import.c b/src/namestore/perf_namestore_api_import.c index cde5eaad5..b4f17f742 100644 --- a/src/namestore/perf_namestore_api_import.c +++ b/src/namestore/perf_namestore_api_import.c @@ -397,6 +397,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/perf_namestore_api_zone_iteration.c b/src/namestore/perf_namestore_api_zone_iteration.c index 0e0b6d93b..bf89d6225 100644 --- a/src/namestore/perf_namestore_api_zone_iteration.c +++ b/src/namestore/perf_namestore_api_zone_iteration.c @@ -369,6 +369,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_common.c b/src/namestore/test_common.c index e35c76075..60749a0b1 100644 --- a/src/namestore/test_common.c +++ b/src/namestore/test_common.c @@ -102,6 +102,7 @@ TNC_test_plugin (const char *cfg_name) GNUNET_asprintf (&cfg_name, file_template, plugin_name); \ if (! TNC_test_plugin (cfg_name)) \ { \ + GNUNET_free (plugin_name); \ GNUNET_free (cfg_name); \ return 77; \ } \ @@ -119,6 +120,7 @@ TNC_test_plugin (const char *cfg_name) GNUNET_asprintf (&cfg_name, "test_namestore_api_%s.conf", plugin_name); \ if (! TNC_test_plugin (cfg_name)) \ { \ + GNUNET_free (plugin_name); \ GNUNET_free (cfg_name); \ return 77; \ } \ diff --git a/src/namestore/test_namestore_api_edit_records.c b/src/namestore/test_namestore_api_edit_records.c index fb588f0e1..fbee57432 100644 --- a/src/namestore/test_namestore_api_edit_records.c +++ b/src/namestore/test_namestore_api_edit_records.c @@ -390,6 +390,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c index 8fa001196..b26674a95 100644 --- a/src/namestore/test_namestore_api_lookup_nick.c +++ b/src/namestore/test_namestore_api_lookup_nick.c @@ -338,6 +338,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c index b129c2996..271f4c40b 100644 --- a/src/namestore/test_namestore_api_monitoring.c +++ b/src/namestore/test_namestore_api_monitoring.c @@ -369,6 +369,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c index bc03de541..87476b309 100644 --- a/src/namestore/test_namestore_api_monitoring_existing.c +++ b/src/namestore/test_namestore_api_monitoring_existing.c @@ -384,6 +384,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 5aab2ebe6..9c00cdfad 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c @@ -210,6 +210,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index ea95a6b57..9a3eabbee 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c @@ -170,6 +170,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c index d291045e5..f8a3dd412 100644 --- a/src/namestore/test_namestore_api_store.c +++ b/src/namestore/test_namestore_api_store.c @@ -163,6 +163,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c index bef19385c..9baa4becd 100644 --- a/src/namestore/test_namestore_api_store_update.c +++ b/src/namestore/test_namestore_api_store_update.c @@ -143,6 +143,7 @@ lookup_success (void *cls, &rd_new, &put_cont, (void *) name); + GNUNET_free (rd_new.data); update_performed = GNUNET_YES; } else @@ -259,6 +260,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_tx_rollback.c b/src/namestore/test_namestore_api_tx_rollback.c index 5b4bc6174..1b1d00c96 100644 --- a/src/namestore/test_namestore_api_tx_rollback.c +++ b/src/namestore/test_namestore_api_tx_rollback.c @@ -255,6 +255,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index e072dbef9..f9bf4986b 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c @@ -455,6 +455,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c index e371bb312..5855b1e87 100644 --- a/src/namestore/test_namestore_api_zone_iteration_nick.c +++ b/src/namestore/test_namestore_api_zone_iteration_nick.c @@ -451,6 +451,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index 074cd4dbb..519383169 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c @@ -438,6 +438,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index 7efe59648..4fe86301c 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c @@ -439,6 +439,7 @@ main (int argc, char *argv[]) } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index dfdefa039..a99b7bc71 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c @@ -257,6 +257,7 @@ main (int argc, } GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); + GNUNET_free (plugin_name); GNUNET_free (cfg_name); return res; } -- 2.38.1 |
|
released some time ago |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-01-29 23:39 | ulfvonbelow | New Issue | |
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-leaks-in-tests.patch | |
2023-02-06 06:00 | schanzen | Assigned To | => schanzen |
2023-02-06 06:00 | schanzen | Status | new => resolved |
2023-02-06 06:00 | schanzen | Resolution | open => fixed |
2023-02-06 06:00 | 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: 0020225 | |
2023-06-01 20:26 | schanzen | Status | resolved => closed |