]> granicus.if.org Git - libevent/commitdiff
memory leak: forgot to free paused rpcs in server
authorNiels Provos <provos@gmail.com>
Fri, 19 Dec 2008 21:03:42 +0000 (21:03 +0000)
committerNiels Provos <provos@gmail.com>
Fri, 19 Dec 2008 21:03:42 +0000 (21:03 +0000)
svn:r962

evrpc.c

diff --git a/evrpc.c b/evrpc.c
index fd3b93f0afbec4fe1b5dd804db58063cd303ee77..5fd0df21c844d82b4a9bd6b8d0e80188cdce1844 100644 (file)
--- a/evrpc.c
+++ b/evrpc.c
@@ -92,10 +92,15 @@ evrpc_free(struct evrpc_base *base)
 {
        struct evrpc *rpc;
        struct evrpc_hook *hook;
+       struct evrpc_hook_ctx *pause;
 
        while ((rpc = TAILQ_FIRST(&base->registered_rpcs)) != NULL) {
                assert(evrpc_unregister_rpc(base, rpc->uri));
        }
+       while ((pause = TAILQ_FIRST(&base->paused_requests)) != NULL) {
+               TAILQ_REMOVE(&base->paused_requests, pause, next);
+               mm_free(pause);
+       }
        while ((hook = TAILQ_FIRST(&base->input_hooks)) != NULL) {
                assert(evrpc_remove_hook(base, EVRPC_INPUT, hook));
        }