From 209c5080e6dc64ee676f790eeaa65e204e978fc8 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 14 Apr 2018 21:05:25 +0200 Subject: [PATCH] system-linux: fix segfault on alloc failure in system_if_check() Detected by Coverity in CID 1433686 Signed-off-by: Hans Dedecker --- system-linux.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.25.1