From bea7031407880386e22fdf378b045eedf6e9b5b0 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 6 Jun 2013 23:23:13 +0200 Subject: [PATCH] log: fix memory leak when using a log handler This is quite important for liblldpctl. --- NEWS | 1 + src/log.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index de1d2972..279c6b45 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ lldpd (0.7.4) * Fixes: + Segfault in lldpcli. + + Memory leak in liblldpctl when using a custom log handler. * Features: + Allow to configure hold value from lldpcli (and hence the TTL). + Allow to configure pattern for valid interfaces from lldpcli. diff --git a/src/log.c b/src/log.c index daad84d5..a3eebfa1 100644 --- a/src/log.c +++ b/src/log.c @@ -131,6 +131,7 @@ vlog(int pri, const char *token, const char *fmt, va_list ap) char *result; if (vasprintf(&result, fmt, ap) != -1) { logh(pri, result); + free(result); return; } /* Otherwise, fallback to output on stderr. */ -- 2.39.5