From 34f52fa62e014b73d9e8ce7143e4859bc28495da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Wed, 10 May 2017 16:28:43 +0200 Subject: [PATCH] ccnl-core-util.c: fix ccnl_cs_dump memory leak --- src/ccnl-core-util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ccnl-core-util.c b/src/ccnl-core-util.c index 0549416c3..0756c9a25 100644 --- a/src/ccnl-core-util.c +++ b/src/ccnl-core-util.c @@ -1110,12 +1110,14 @@ ccnl_cs_dump(struct ccnl_relay_s *ccnl) { struct ccnl_content_s *c = ccnl->contents; unsigned i = 0; + char *s; while (c) { printf("CS[%u]: %s [%d]: %s\n", i++, - ccnl_prefix_to_path(c->pkt->pfx), + (s = ccnl_prefix_to_path(c->pkt->pfx)), (c->pkt->pfx->chunknum)? *(c->pkt->pfx->chunknum) : -1, c->pkt->content); c = c->next; + ccnl_free(s); } }