free getaddrinfo() results and avoid leaks in ecore_con.

This was affecting ecore_con users, specially modules that keep
polling the network, like forecasts or weather.

patch by manio, see bug #305.


SVN revision: 40488
This commit is contained in:
Gustavo Sverzut Barbieri 2009-05-02 19:02:09 +00:00
parent 8ef8b1e15a
commit 4fd5d0c794
1 changed files with 3 additions and 1 deletions

View File

@ -197,7 +197,7 @@ ecore_con_info_get(Ecore_Con_Server *svr,
if ((cbdata->pid = fork()) == 0)
{
Ecore_Con_Info *container;
struct addrinfo *result;
struct addrinfo *result = NULL;
char service[NI_MAXSERV];
char hbuf[NI_MAXHOST];
char sbuf[NI_MAXSERV];
@ -239,6 +239,8 @@ ecore_con_info_get(Ecore_Con_Server *svr,
}
on_error:
if (result)
freeaddrinfo(result);
err = write(fd[1], "", 1);
close(fd[1]);
# ifdef __USE_ISOC99