From 4dd8bd13d2dad67dae732a97e9976d701145c65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Tue, 9 May 2017 10:07:03 +0200 Subject: [PATCH 1/2] ccn-lite: shell: free prefix after preparing the content --- sys/shell/commands/sc_ccnl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/shell/commands/sc_ccnl.c b/sys/shell/commands/sc_ccnl.c index 3203578aa1..5277d9af36 100644 --- a/sys/shell/commands/sc_ccnl.c +++ b/sys/shell/commands/sc_ccnl.c @@ -120,6 +120,8 @@ int _ccnl_content(int argc, char **argv) arg_len = ccnl_ndntlv_prependContent(prefix, (unsigned char*) body, arg_len, NULL, NULL, &offs, _out); + free_prefix(prefix); + unsigned char *olddata; unsigned char *data = olddata = _out + offs; From 3db032d41e5c266fb18729caa27390b40e77e533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Tue, 9 May 2017 10:11:39 +0200 Subject: [PATCH 2/2] ccn-lite: shell: free all memory, not just prefix struct --- sys/shell/commands/sc_ccnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/shell/commands/sc_ccnl.c b/sys/shell/commands/sc_ccnl.c index 5277d9af36..c0768d4101 100644 --- a/sys/shell/commands/sc_ccnl.c +++ b/sys/shell/commands/sc_ccnl.c @@ -226,7 +226,7 @@ int _ccnl_interest(int argc, char **argv) printf("Content received: %s\n", _cont_buf); return 0; } - ccnl_free(prefix); + free_prefix(prefix); gnrc_netreg_unregister(GNRC_NETTYPE_CCN_CHUNK, &_ne); } printf("Timeout! No content received in response to the Interest for %s.\n", argv[1]);