From: Michael Tremer Date: Mon, 9 May 2022 17:59:29 +0000 (+0000) Subject: logging: Do not crash when log callback isn't set X-Git-Tag: 0.9.28~809 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c99aaee4848bca38e0b4e9372a2968432d5a3d69;p=pakfire.git logging: Do not crash when log callback isn't set This is now possible because we have a new function to modify the callback. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 5b6991186..5fe47ffae 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -1659,6 +1659,10 @@ void pakfire_log(struct pakfire* pakfire, int priority, const char* file, int li const char* fn, const char* format, ...) { va_list args; + // Do not do anything if callback isn't set + if (!pakfire->callbacks.log) + return; + // Save errno int saved_errno = errno;