# HG changeset patch # User Mark Doliner # Date 1221083949 0 # Node ID b703102fa0a5deb39ea882cf79a41abd579761d3 # Parent 005649461c774cbb49915b7f8fa0bc1f8ed4a1bd Fix this g_return_val_if_fail. It should have been returning TRUE or FALSE and not -1. But I think it was also leaking. I made the log message a little better, too. diff -r 005649461c77 -r b703102fa0a5 libpurple/dnsquery.c --- a/libpurple/dnsquery.c Wed Sep 10 21:48:33 2008 +0000 +++ b/libpurple/dnsquery.c Wed Sep 10 21:59:09 2008 +0000 @@ -412,7 +412,7 @@ { pid_t pid; dns_params_t dns_params; - int rc; + ssize_t rc; /* This waitpid might return the child's PID if it has recently * exited, or it might return an error if it exited "long @@ -444,8 +444,13 @@ purple_dnsquery_resolver_destroy(resolver); return FALSE; } - - g_return_val_if_fail(rc == sizeof(dns_params), -1); + if (rc < sizeof(dns_params)) { + purple_debug_error("dns", "Tried to read %" G_GSSIZE_FORMAT + " bytes from child but only read %" G_GSSIZE_FORMAT "\n", + sizeof(dns_params), rc); + purple_dnsquery_resolver_destroy(resolver); + return FALSE; + } purple_debug_info("dns", "Successfully sent DNS request to child %d\n",