ecore_con: Fix dereferencing of null pointer
authorChristopher Michael <cp.michael@samsung.com>
Thu, 14 Mar 2019 11:22:54 +0000 (07:22 -0400)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 2 Apr 2019 03:45:17 +0000 (12:45 +0900)
Summary:
Coverity reports that 'svr' might be NULL here, so we should check it
is valid before trying to use it.

Fixes Coverity CID1396990

@fix

Depends on D8320

Reviewers: raster, cedric, q66, zmike, bu5hm4n, stefan

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8321

src/lib/ecore_con/ecore_con_legacy.c

index 4349946..5562bff 100644 (file)
@@ -293,7 +293,7 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
           efl_event_callback_array_del(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl);
 
         parent = efl_parent_get(cl->socket);
-        if (parent && (parent != svr->server))
+        if (parent && svr && (parent != svr->server))
           efl_del(cl->socket); /* we own it */
         else
           efl_unref(cl->socket);