]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: make netlink_get_reply_callback_count() accept NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Aug 2025 18:54:04 +0000 (03:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Sep 2025 06:33:17 +0000 (15:33 +0900)
src/libsystemd/sd-netlink/sd-netlink.c

index 57e5a652149d9c45ff019541f90fdc0b57a67d8c..fe0c1a0080af0401948b743192840a582703810e 100644 (file)
@@ -466,7 +466,8 @@ static int timeout_compare(const void *a, const void *b) {
 }
 
 size_t netlink_get_reply_callback_count(sd_netlink *nl) {
-        assert(nl);
+        if (!nl)
+                return 0;
 
         return hashmap_size(nl->reply_callbacks);
 }