summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2021-10-03 09:18:09 +0300
committerdefanor <defanor@uberspace.net>2021-10-03 09:18:09 +0300
commit804fe06083770b89ebcee85614ec52b30c251d87 (patch)
treec25bff63a6a399c2efb5243a2c540f7f9ecf2907
parent024e998f8b73047eb2ae56ea92cb2cbc0bbedc17 (diff)
Free rexmpp_dns_query_cb_data structures
-rw-r--r--src/rexmpp_dns.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rexmpp_dns.c b/src/rexmpp_dns.c
index 00c9074..5c3f4f6 100644
--- a/src/rexmpp_dns.c
+++ b/src/rexmpp_dns.c
@@ -212,6 +212,7 @@ void rexmpp_dns_cb (void *ptr,
ub_strerror(err));
ub_resolve_free(result);
d->cb(s, d->ptr, NULL);
+ free(d);
return;
}
@@ -227,6 +228,7 @@ void rexmpp_dns_cb (void *ptr,
rexmpp_log(s, LOG_DEBUG, "No data in the query result");
ub_resolve_free(result);
d->cb(s, d->ptr, NULL);
+ free(d);
return;
}
@@ -249,6 +251,7 @@ void rexmpp_dns_cb (void *ptr,
res->data[i + 1] = NULL;
rexmpp_dns_result_free(res);
d->cb(s, d->ptr, NULL);
+ free(d);
return;
}
} else {
@@ -278,6 +281,7 @@ void rexmpp_dns_cb (void *ptr,
rexmpp_log(s, LOG_WARNING, "A DNS query failure: %s",
ares_strerror(err));
d->cb(s, d->ptr, NULL);
+ free(d);
return;
}
/* c-ares won't just tell us the type, but it does check for it in
@@ -309,10 +313,11 @@ void rexmpp_dns_cb (void *ptr,
r->data[size] = NULL;
ares_free_data(srv);
d->cb(s, d->ptr, r);
- }else {
+ } else {
rexmpp_log(s, LOG_ERR, "Failed to parse a query");
d->cb(s, d->ptr, NULL);
}
+ free(d);
}
#endif