View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007632 | GNUnet | rest service | public | 2023-01-29 22:34 | 2023-06-01 20:26 |
| 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.19.4 | ||
| Summary | 0007632: Memory leak in gnunet-rest-server | ||||
| Description | basic_auth_file in run() is never freed. | ||||
| Steps To Reproduce | ./configure --enable-sanitizer make make install make check | ||||
| Additional Information | Patch attached. | ||||
| Tags | memory-leak, patch | ||||
| Attached Files | 0001-REST-don-t-leak-basic_auth_file.patch (1,137 bytes)
From 9046e4cefd448ebaf4d22f13d8324495969ff316 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 06:01:34 -0600
Subject: [PATCH] REST: don't leak basic_auth_file.
---
src/rest/gnunet-rest-server.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index f9a949e61..5163c2271 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -1193,6 +1193,7 @@ run (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"write",
basic_auth_file);
+ GNUNET_free (basic_auth_file);
}
else
{
@@ -1205,8 +1206,10 @@ run (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unable to read basic auth secret file.\n");
GNUNET_SCHEDULER_shutdown ();
+ GNUNET_free (basic_auth_file);
return;
}
+ GNUNET_free (basic_auth_file);
if (0 != getlogin_r (cuser, _POSIX_LOGIN_NAME_MAX))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
--
2.38.1
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2023-01-29 22:34 | ulfvonbelow | New Issue | |
| 2023-01-29 22:34 | ulfvonbelow | Status | new => assigned |
| 2023-01-29 22:34 | ulfvonbelow | Assigned To | => schanzen |
| 2023-01-29 22:34 | ulfvonbelow | Tag Attached: memory-leak | |
| 2023-01-29 22:34 | ulfvonbelow | Tag Attached: patch | |
| 2023-01-29 22:34 | ulfvonbelow | File Added: 0001-REST-don-t-leak-basic_auth_file.patch | |
| 2023-02-06 06:14 | schanzen | Status | assigned => resolved |
| 2023-02-06 06:14 | schanzen | Resolution | open => fixed |
| 2023-02-06 06:14 | 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: 0020235 | |
| 2023-06-01 20:26 | schanzen | Status | resolved => closed |