From 1e52e1ff518987092cfe94bc5c9c4479ed535019 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Jul 2010 11:30:27 +0100 Subject: When cleaning up queries, q->data is free()d. Even if it turns out to be the "struct irc" containing all data belonging to a session. Sanitise memory management a little bit here. (There are some memory leaks in here too that need to be fixed at some point.) --- query.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'query.h') diff --git a/query.h b/query.h index e0ca32ec..f0419573 100644 --- a/query.h +++ b/query.h @@ -32,13 +32,14 @@ typedef struct query { struct im_connection *ic; char *question; - query_callback yes, no; + query_callback yes, no, free; void *data; struct query *next; } query_t; query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, - query_callback yes, query_callback no, void *data ); + query_callback yes, query_callback no, query_callback free, + void *data ); void query_del( irc_t *irc, query_t *q ); void query_del_by_conn( irc_t *irc, struct im_connection *ic ); void query_answer( irc_t *irc, query_t *q, int ans ); -- cgit v1.2.3