From 401918453f6a8e0792788c626120fed70f315afe Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 27 Jul 2008 18:58:15 +0200 Subject: add new API asyncns_freeanswer() --- libasyncns/asyncns.c | 6 ++++++ libasyncns/asyncns.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'libasyncns') 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); -- cgit