From: Vincent Bernat Date: Thu, 6 Jun 2013 21:23:13 +0000 (+0200) Subject: log: fix memory leak when using a log handler X-Git-Tag: 0.7.4~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bea7031407880386e22fdf378b045eedf6e9b5b0;p=thirdparty%2Flldpd.git log: fix memory leak when using a log handler This is quite important for liblldpctl. --- 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. */