]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
fixup! treewide: replace VERBOSE_STATUS, WITH_VERBOSE, etc.
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 13 Jul 2021 17:27:07 +0000 (19:27 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 13 Jul 2021 17:27:14 +0000 (19:27 +0200)
I forgot that in some parts of code `qry` used for logging
could really be NULL; I suppose this should be cheap enough.

lib/log.h

index 142fb856bb5f14970f2277381dfa5701dafb8de2..72e0f5918362f9a484128c6ae6f5d0c91a7b5917 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -236,7 +236,7 @@ void kr_log_q1(const struct kr_query *qry, enum kr_log_group group, const char *
  */
 #define kr_log_is_debug(grp, req) \
        __builtin_expect(kr_log_is_debug_fun(LOG_GRP_ ## grp, (req)), false)
-#define kr_log_is_debug_qry(grp, qry) kr_log_is_debug(grp, (qry)->request)
+#define kr_log_is_debug_qry(grp, qry) kr_log_is_debug(grp, (qry) ? (qry)->request : NULL)
 KR_EXPORT
 bool kr_log_is_debug_fun(enum kr_log_group group, const struct kr_request *req);