diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 613c27ce..ec1ede7c 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -358,6 +358,13 @@ _iq_id_handler_free(ProfIqHandler* handler) void iq_id_handler_add(const char* const id, ProfIqCallback func, ProfIqFreeCallback free_func, void* userdata) { + if (id == NULL) { + if (free_func) { + free_func(userdata); + } + return; + } + ProfIqHandler* handler = malloc(sizeof(ProfIqHandler)); if (handler) { handler->func = func;