dispatcher: drop a useless condition
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 4 Feb 2016 15:51:36 +0000 (16:51 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Thu, 11 Feb 2016 16:01:03 +0000 (17:01 +0100)
The request->scripts are allocated in handle_action() and request_free() is
only called after that, so it never sees it NULL. Coverity knows:

CID 59385 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking request->scripts suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.

callouts/nm-dispatcher.c

index a0201ff..ece5ff2 100644 (file)
@@ -206,8 +206,7 @@ request_free (Request *request)
        g_free (request->action);
        g_free (request->iface);
        g_strfreev (request->envp);
-       if (request->scripts)
-               g_ptr_array_free (request->scripts, TRUE);
+       g_ptr_array_free (request->scripts, TRUE);
 
        g_slice_free (Request, request);
 }