summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-24 14:20:41 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-03-29 13:24:21 +0200
commitff0670edf399882329daa242247523d5f250f9a5 (patch)
tree2dd0de155a4b297485532126172a7d478add819c /src
parent3abad6a6f9ae4cfa65c9f6d5f15208790449eefe (diff)
vty: Fix a memory leak in the vty description command
Before assigning a new string, free the previous one. This assume that it was allocated with talloc which should be true for the osmocom users.
Diffstat (limited to 'src')
-rw-r--r--src/vty/logging_vty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 4cab22a3..b037a5bc 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -269,6 +269,8 @@ gDEFUN(cfg_description, cfg_description_cmd,
return CMD_WARNING;
}
+ if (*dptr)
+ talloc_free(*dptr);
*dptr = argv_concat(argv, argc, 0);
if (!dptr)
return CMD_WARNING;