resolve: fix crash in resolve_exit

method.ops is NULL, which causes method.ops->exit to crash. This
adds a check that method.ops is not NULL before dereferencing.

Fixes:

Aborting (signal 11) [/home/jprestwo/iwd/src/iwd]
++++++++ backtrace ++++++++
0  0x7f016b59cf20 in /lib/x86_64-linux-gnu/libc.so.6
1  0x432057 in resolve_exit() at /home/jprestwo/iwd/src/resolve.c:295
2  0x403b61 in iwd_modules_exit() at /home/jprestwo/iwd/src/main.c:195
3  0x7f016b57fb97 in /lib/x86_64-linux-gnu/libc.so.6
+++++++++++++++++++++++++++
This commit is contained in:
James Prestwood 2019-07-03 10:42:09 -07:00 committed by Denis Kenzior
parent e5dedc3378
commit 5ca3c4495e
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ static int resolve_init(void)
static void resolve_exit(void)
{
if (!method.ops->exit)
if (!method.ops || !method.ops->exit)
return;
method.ops->exit(method.data);