From 18dfd10b71ea05eb22888084a833086a3b0e99a3 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sun, 3 Mar 2013 18:44:33 +0100 Subject: [PATCH] core/exceptions: fix memory leak in wsgi_exception_setup_handlers Reported by Coverity as CID #989249. --- core/exceptions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/exceptions.c b/core/exceptions.c index fdaf0a04..32bf468a 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -473,8 +473,11 @@ void uwsgi_exception_setup_handlers() { struct uwsgi_exception_handler *ueh = uwsgi_exception_handler_by_name(handler); if (!ueh) { uwsgi_log("unable to find exception handler: %s\n", handler); + free(handler); exit(1); } + free(handler); + struct uwsgi_exception_handler_instance *uehi = uwsgi_calloc(sizeof(struct uwsgi_exception_handler_instance)); uehi->handler = ueh; if (colon) {