From ff0670edf399882329daa242247523d5f250f9a5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 24 Feb 2011 14:20:41 +0100 Subject: 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. --- src/vty/logging_vty.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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; -- cgit v1.2.3