summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libasyncns/asyncns.c6
-rw-r--r--libasyncns/asyncns.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/libasyncns/asyncns.c b/libasyncns/asyncns.c
index 08fcd59..d8d657a 100644
--- a/libasyncns/asyncns.c
+++ b/libasyncns/asyncns.c
@@ -1135,3 +1135,9 @@ void* asyncns_getuserdata(asyncns_t *asyncns, asyncns_query_t *q) {
return q->userdata;
}
+
+void asyncns_freeanswer(unsigned char *answer) {
+ assert(answer);
+
+ free(answer);
+}
diff --git a/libasyncns/asyncns.h b/libasyncns/asyncns.h
index a57be52..b316668 100644
--- a/libasyncns/asyncns.h
+++ b/libasyncns/asyncns.h
@@ -141,6 +141,9 @@ asyncns_getaddrinfo_done(). Make sure to use this functions instead of
the libc's freeaddrinfo()! */
void asyncns_freeaddrinfo(struct addrinfo *ai);
+/** Free the answer data as returned by asyncns_res_done().*/
+void asyncns_freeanswer(unsigned char *answer);
+
/** Returns non-zero when the query operation specified by q has been completed */
int asyncns_isdone(asyncns_t *asyncns, asyncns_query_t*q);