summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-network/sd-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-06-10 15:55:09 +0200
committerTom Gundersen <teg@jklm.no>2015-06-10 16:34:43 +0200
commit0b3476266f6600b59b1d2c5b7dccf7fba4947850 (patch)
treea94ee9d73b4183fc12e05b78f83da10480aa8cf6 /src/libsystemd/sd-network/sd-network.c
parentsd-bus: remove ucred parameter from bus_message_from_header() since we don't ... (diff)
downloadsystemd-0b3476266f6600b59b1d2c5b7dccf7fba4947850.tar.xz
systemd-0b3476266f6600b59b1d2c5b7dccf7fba4947850.zip
sd-network: allow NULL in sd_network_monitor_unref
Match rest of codebase, we always allow unref'ing NULL.
Diffstat (limited to 'src/libsystemd/sd-network/sd-network.c')
-rw-r--r--src/libsystemd/sd-network/sd-network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c
index db1f6997cb..587941497d 100644
--- a/src/libsystemd/sd-network/sd-network.c
+++ b/src/libsystemd/sd-network/sd-network.c
@@ -329,10 +329,10 @@ _public_ int sd_network_monitor_new(sd_network_monitor **m, const char *category
_public_ sd_network_monitor* sd_network_monitor_unref(sd_network_monitor *m) {
int fd;
- assert_return(m, NULL);
-
- fd = MONITOR_TO_FD(m);
- close_nointr(fd);
+ if (m) {
+ fd = MONITOR_TO_FD(m);
+ close_nointr(fd);
+ }
return NULL;
}