diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2024-01-21 12:19:35 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2024-01-31 10:27:57 +0100 |
commit | 467a04de7d615dac943c051c27b851316c198bde (patch) | |
tree | 3645524737689fa5e08e582393d98f5fe1f3a65e /src/ipcpd | |
parent | db09a1406e8165dc607a900b719852e2275cf717 (diff) | |
download | ouroboros-467a04de7d615dac943c051c27b851316c198bde.tar.gz ouroboros-467a04de7d615dac943c051c27b851316c198bde.zip |
ipcpd: Fix memleak in rib_readdir
On fail_dup, the last element (0) was not free'd.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/ipcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 61c811c3..312c4a79 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -183,8 +183,8 @@ static int ipcp_rib_readdir(char *** buf) return i; fail_dup: - while (--i > 0) - free((*buf)[i]); + while (i > 0) + free((*buf)[--i]); fail: free(*buf); |