diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2018-04-14 21:05:25 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2018-04-14 21:12:20 +0200 |
commit | 209c5080e6dc64ee676f790eeaa65e204e978fc8 (patch) | |
tree | ab54618230545ee3ee4299605a3e36f615037950 /system-linux.c | |
parent | 4a8e20e5aefc39bc1c9d37d07db8bda97251b4b9 (diff) |
system-linux: fix segfault on alloc failure in system_if_check()
Detected by Coverity in CID 1433686
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'system-linux.c')
-rw-r--r-- | system-linux.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |