View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007651 | GNUnet | DHT service | public | 2023-01-30 00:49 | 2024-06-08 12:03 |
Reporter | ulfvonbelow | Assigned To | schanzen | ||
Priority | normal | Severity | trivial | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Git master | ||||
Target Version | 0.19.4 | Fixed in Version | 0.21.2 | ||
Summary | 0007651: "Memory leak" in gnunet-dht-get and gnunet-dht-put | ||||
Description | The argv created by GNUNET_STRINGS_get_utf8_args is never freed. | ||||
Steps To Reproduce | ./configure --enable-sanitizer make make install make check | ||||
Additional Information | Not a real problem, again, but sanitizers... Patch attached. | ||||
Tags | patch | ||||
Attached Files | 0001-DHT-remove-memory-leak-in-gnunet-dht-get-put.patch (2,234 bytes)
From 5ecf4d9a574395b7a2c62623f658bcc043eca28f Mon Sep 17 00:00:00 2001 From: ulfvonbelow <strilen@tilde.club> Date: Sun, 29 Jan 2023 07:08:37 -0600 Subject: [PATCH] DHT: remove "memory leak" in gnunet-dht-{get,put}. Not really a memory leak, but good to get the sanitizers off our back. --- src/dht/gnunet-dht-get.c | 26 ++++++++++++++------------ src/dht/gnunet-dht-put.c | 9 +++++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 1ae9235f8..4a071dbad 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c @@ -329,18 +329,20 @@ main (int argc, char *const *argv) GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run ( - argc, - argv, - "gnunet-dht-get", - gettext_noop ( - "Issue a GET request to the GNUnet DHT, prints results."), - options, - &run, - NULL)) - ? ret - : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run ( + argc, + argv, + "gnunet-dht-get", + gettext_noop ( + "Issue a GET request to the GNUnet DHT, prints results."), + options, + &run, + NULL)) + ? ret + : 1; + GNUNET_free (argv); + return ret; } diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index 531107ef2..2281ff56b 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c @@ -226,13 +226,12 @@ main (int argc, char *const *argv) GNUNET_GETOPT_OPTION_END }; - if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; expiration = GNUNET_TIME_UNIT_HOURS; - return (GNUNET_OK == + ret = (GNUNET_OK == GNUNET_PROGRAM_run ( argc, argv, @@ -242,8 +241,10 @@ main (int argc, char *const *argv) options, &run, NULL)) - ? ret - : 1; + ? ret + : 1; + GNUNET_free (argv); + return ret; } -- 2.38.1 | ||||
|
Actually, reverting this as we cannot free a const pointer here. This may have to be fixed in PROGRAM_run... |
|
ab66a7a9d..eabc1baaf |
|
eabc1baaf980d8948f3fc0ac83a84446d5f1b226 didn't reintroduce the 'ret = ...' line to replace the 'return ...' line, so it still always returns before the memory is freed. So the sanitizers still fail on this. |
|
Fix committed to master branch. |
|
released some time ago |
|
The fix seems to have made its way only to gnunet-dht-get, not gnunet-dht-put |
|
95f0616e0ca40eb2eef5881b0eaccc110a27fddc |
|
Fix committed to master branch. |
|
0.21.2 released |
gnunet: master f52d578f 2023-06-01 22:21 Details Diff |
DHT: Fix memory leak. Fixes 0007651 |
Affected Issues 0007651 |
|
mod - src/dht/gnunet-dht-get.c | Diff File | ||
gnunet: master 95f0616e 2024-05-05 16:03 Details Diff |
DHT: Fix memory lead in gnunet-dht-put. Fixes 0007651 |
Affected Issues 0007651 |
|
mod - src/cli/dht/gnunet-dht-put.c | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-01-30 00:49 | ulfvonbelow | New Issue | |
2023-01-30 00:49 | ulfvonbelow | Tag Attached: patch | |
2023-01-30 00:49 | ulfvonbelow | File Added: 0001-DHT-remove-memory-leak-in-gnunet-dht-get-put.patch | |
2023-02-06 05:53 | schanzen | Assigned To | => schanzen |
2023-02-06 05:53 | schanzen | Status | new => resolved |
2023-02-06 05:53 | schanzen | Resolution | open => fixed |
2023-02-06 05:53 | schanzen | Fixed in Version | => 0.19.4 |
2023-02-06 06:19 | schanzen | Target Version | => 0.19.4 |
2023-02-06 06:54 | schanzen | Status | resolved => feedback |
2023-02-06 06:54 | schanzen | Resolution | fixed => reopened |
2023-02-06 06:54 | schanzen | Note Added: 0019765 | |
2023-02-06 07:05 | schanzen | Status | feedback => resolved |
2023-02-06 07:05 | schanzen | Resolution | reopened => fixed |
2023-02-06 07:05 | schanzen | Note Added: 0019766 | |
2023-05-25 18:51 | ulfvonbelow | Status | resolved => feedback |
2023-05-25 18:51 | ulfvonbelow | Resolution | fixed => reopened |
2023-05-25 18:51 | ulfvonbelow | Note Added: 0020201 | |
2023-06-01 20:21 | schanzen | Changeset attached | => gnunet master f52d578f |
2023-06-01 20:21 | schanzen | Note Added: 0020211 | |
2023-06-01 20:21 | schanzen | Status | feedback => resolved |
2023-06-01 20:21 | schanzen | Resolution | reopened => fixed |
2023-06-01 20:26 | schanzen | Note Added: 0020212 | |
2023-06-01 20:26 | schanzen | Status | resolved => closed |
2024-05-03 03:49 | ulfvonbelow | Status | closed => feedback |
2024-05-03 03:49 | ulfvonbelow | Resolution | fixed => reopened |
2024-05-03 03:49 | ulfvonbelow | Note Added: 0022331 | |
2024-05-05 14:04 | schanzen | Status | feedback => resolved |
2024-05-05 14:04 | schanzen | Fixed in Version | 0.19.4 => 0.21.2 |
2024-05-05 14:04 | schanzen | Note Added: 0022343 | |
2024-05-05 14:04 | schanzen | Changeset attached | => gnunet master 95f0616e |
2024-05-05 14:04 | schanzen | Note Added: 0022344 | |
2024-05-05 14:04 | schanzen | Resolution | reopened => fixed |
2024-06-08 12:03 | schanzen | Note Added: 0022556 | |
2024-06-08 12:03 | schanzen | Status | resolved => closed |