View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008812 | GNUnet | transport service | public | 2024-05-07 05:37 | 2024-06-08 12:03 |
| Reporter | ulfvonbelow | Assigned To | schanzen | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | x86-64 | OS | Guix System | OS Version | a1d711c92e |
| Product Version | Git master | ||||
| Fixed in Version | 0.21.2 | ||||
| Summary | 0008812: memory leak in extract_address in tcp communicator | ||||
| Description | res = GNUNET_strdup (token); addr = GNUNET_strdup (res); and then later on addr gets returned, while res is leaked. res is used nowhere else in the entire procedure. Strange piece of code. | ||||
| Steps To Reproduce | 1. Build gnunet with --enable-sanitizer 2. Start the node with gnunet-arm -s 3. Stop the node after a bit with gnunet-arm -e 4. Observe reported memory leak wherever you've configured communicator-tcp to log to | ||||
| Additional Information | Patch attached. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 0001-transport-fix-memory-leak-in-extract_address-in-tcp-.patch (1,041 bytes)
From cea273582740ca85377d29f58c69856256b99756 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <striness@tilde.club>
Date: Sun, 5 May 2024 01:51:36 -0500
Subject: [PATCH] transport: fix memory leak in extract_address in tcp
communicator.
---
src/service/transport/gnunet-communicator-tcp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/service/transport/gnunet-communicator-tcp.c b/src/service/transport/gnunet-communicator-tcp.c
index 02a547335..d13473b0a 100644
--- a/src/service/transport/gnunet-communicator-tcp.c
+++ b/src/service/transport/gnunet-communicator-tcp.c
@@ -2369,7 +2369,6 @@ extract_address (const char *bindto)
char *token;
char *cp;
char *rest = NULL;
- char *res;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"extract address with bindto %s\n",
@@ -2402,8 +2401,7 @@ extract_address (const char *bindto)
else
{
token++;
- res = GNUNET_strdup (token);
- addr = GNUNET_strdup (res);
+ addr = GNUNET_strdup (token);
}
}
--
2.41.0
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2024-05-07 05:37 | ulfvonbelow | New Issue | |
| 2024-05-07 05:37 | ulfvonbelow | File Added: 0001-transport-fix-memory-leak-in-extract_address-in-tcp-.patch | |
| 2024-05-13 10:51 | schanzen | Assigned To | => schanzen |
| 2024-05-13 10:51 | schanzen | Status | new => resolved |
| 2024-05-13 10:51 | schanzen | Resolution | open => fixed |
| 2024-05-13 10:51 | schanzen | Fixed in Version | => 0.21.2 |
| 2024-05-13 10:51 | schanzen | Note Added: 0022396 | |
| 2024-06-08 12:03 | schanzen | Note Added: 0022533 | |
| 2024-06-08 12:03 | schanzen | Status | resolved => closed |