From: Vincent Bernat Date: Wed, 9 Apr 2014 19:03:17 +0000 (+0200) Subject: compat: fix vsyslog to rely on the result of vasprintf X-Git-Tag: 0.7.8~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6579462d82d478def353593cf2e3c48fe93f41b0;p=thirdparty%2Flldpd.git compat: fix vsyslog to rely on the result of vasprintf --- diff --git a/src/compat/vsyslog.c b/src/compat/vsyslog.c index 8c0f8f2d..be59210a 100644 --- a/src/compat/vsyslog.c +++ b/src/compat/vsyslog.c @@ -8,8 +8,9 @@ void vsyslog(int facility, const char *format, va_list ap) { char *msg = NULL; - vasprintf(&msg, format, ap); - if (!msg) return; + if (vasprintf(&msg, format, ap) == -1) { + return; + } syslog(facility, "%s", msg); free(msg); }