summaryrefslogtreecommitdiffstats
path: root/libasyncns
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-07-27 18:58:15 +0200
committerLennart Poettering <lennart@poettering.net>2008-07-27 18:58:15 +0200
commit401918453f6a8e0792788c626120fed70f315afe (patch)
treea4358cd0f3e8d62cc62ba274d44e5f16ed3b8e9d /libasyncns
parent25e22659bf0fed89a30bedd0386c36fa147885c8 (diff)
add new API asyncns_freeanswer()
Diffstat (limited to 'libasyncns')
-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);