summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2024-01-21 12:19:35 +0100
committerSander Vrijders <[email protected]>2024-01-31 10:27:57 +0100
commit467a04de7d615dac943c051c27b851316c198bde (patch)
tree3645524737689fa5e08e582393d98f5fe1f3a65e
parentdb09a1406e8165dc607a900b719852e2275cf717 (diff)
downloadouroboros-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 <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
-rw-r--r--src/ipcpd/ipcp.c4
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);