From: Hans Dedecker Date: Sat, 14 Apr 2018 19:05:25 +0000 (+0200) Subject: system-linux: fix segfault on alloc failure in system_if_check() X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=209c5080e6dc64ee676f790eeaa65e204e978fc8 system-linux: fix segfault on alloc failure in system_if_check() Detected by Coverity in CID 1433686 Signed-off-by: Hans Dedecker --- diff --git a/system-linux.c b/system-linux.c index b839b4c..9933201 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1571,6 +1571,9 @@ int system_if_check(struct device *dev) }; int ret = 1; + if (!cb) + return ret; + msg = nlmsg_alloc_simple(RTM_GETLINK, 0); if (!msg) goto out;