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:
Carsten Haitzler 2014-08-13 08:44:44 +09:00
parent db447bece5
commit c0ca1bcf44
1 changed files with 4 additions and 4 deletions

View File

@ -372,6 +372,8 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
svr->clients = NULL;
svr->ppid = getpid();
servers = eina_list_append(servers, svr);
svr->name = strdup(name);
if (!svr->name)
goto error;
@ -409,8 +411,6 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
svr))
goto error;
servers = eina_list_append(servers, svr);
return svr;
error:
@ -449,6 +449,8 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
svr->clients = NULL;
svr->client_limit = -1;
servers = eina_list_append(servers, svr);
svr->name = strdup(name);
if (!svr->name)
goto error;
@ -502,8 +504,6 @@ ecore_con_server_connect(Ecore_Con_Type compl_type,
/* UDP and MCAST */
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;
error: