Skip to content

Commit

Permalink
fix memory leak in ares_getnameinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
acmorrow authored and bagder committed Jun 16, 2010
1 parent 954ec10 commit d6b8698
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ares_getnameinfo.c
Expand Up @@ -243,6 +243,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts,
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts,
(char *)(host->h_name),
service);
free(niquery);
return;
}
/* We couldn't find the host, but it's OK, we can use the IP */
Expand Down Expand Up @@ -273,6 +274,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts,
}
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf,
service);
free(niquery);
return;
}
niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL);
Expand Down

0 comments on commit d6b8698

Please sign in to comment.