forked from enlightenment/efl
ecore-con - fix possible leak due to other fix
this fixes potential leak due to
ff652084e0
fixing a valgrind access
issue. make sure the server is in the list before handling error
conditions in case a callback sets delete_me (should never though).
This commit is contained in:
parent
db447bece5
commit
c0ca1bcf44
|
@ -372,6 +372,8 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
|
||||||
svr->clients = NULL;
|
svr->clients = NULL;
|
||||||
svr->ppid = getpid();
|
svr->ppid = getpid();
|
||||||
|
|
||||||
|
servers = eina_list_append(servers, svr);
|
||||||
|
|
||||||
svr->name = strdup(name);
|
svr->name = strdup(name);
|
||||||
if (!svr->name)
|
if (!svr->name)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -409,8 +411,6 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
|
||||||
svr))
|
svr))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
servers = eina_list_append(servers, svr);
|
|
||||||
|
|
||||||
return svr;
|
return svr;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -449,6 +449,8 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
|
||||||
svr->clients = NULL;
|
svr->clients = NULL;
|
||||||
svr->client_limit = -1;
|
svr->client_limit = -1;
|
||||||
|
|
||||||
|
servers = eina_list_append(servers, svr);
|
||||||
|
|
||||||
svr->name = strdup(name);
|
svr->name = strdup(name);
|
||||||
if (!svr->name)
|
if (!svr->name)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -502,8 +504,6 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
|
||||||
/* UDP and MCAST */
|
/* UDP and MCAST */
|
||||||
EINA_SAFETY_ON_FALSE_GOTO(ecore_con_info_udp_connect(svr, _ecore_con_cb_udp_connect, svr), error);
|
EINA_SAFETY_ON_FALSE_GOTO(ecore_con_info_udp_connect(svr, _ecore_con_cb_udp_connect, svr), error);
|
||||||
|
|
||||||
servers = eina_list_append(servers, svr);
|
|
||||||
|
|
||||||
return svr;
|
return svr;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
Loading…
Reference in New Issue