If there is situation when server is closed prior to client, the client pointer pointing to server must be reset and check must be there during client deletion

Summary: During mobile product testing, we got a crash with callstack which suggest server is getting deleted prior to client. On valgrind analysis we found invalid write operation with same callstack. callstack is pasted in comment section.

Test Plan: create a situation where server got deleted prior to client.

Reviewers: raster, cedric

Subscribers: govi, rajeshps, jpeg

Differential Revision: https://phab.enlightenment.org/D4152
This commit is contained in:
Prince Kumar Dubey 2016-07-11 22:29:04 +09:00 committed by Carsten Haitzler (Rasterman)
parent 4329a359dc
commit 8fbb6dbbbb
1 changed files with 6 additions and 2 deletions

View File

@ -461,7 +461,10 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
Ecore_Ipc_Client *cl;
EINA_LIST_FREE(svr->clients, cl)
ecore_ipc_client_del(cl);
{
cl->svr = NULL;
ecore_ipc_client_del(cl);
}
if (svr->server) ecore_con_server_del(svr->server);
servers = eina_list_remove(servers, svr);
@ -875,7 +878,8 @@ ecore_ipc_client_del(Ecore_Ipc_Client *cl)
{
svr = cl->svr;
if (cl->client) ecore_con_client_del(cl->client);
svr->clients = eina_list_remove(svr->clients, cl);
if (ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
svr->clients = eina_list_remove(svr->clients, cl);
if (cl->buf) free(cl->buf);
ECORE_MAGIC_SET(cl, ECORE_MAGIC_NONE);
free(cl);