core/exceptions: fix memory leak in wsgi_exception_setup_handlers

Reported by Coverity as CID #989249.
This commit is contained in:
Riccardo Magliocchetti
2013-03-03 18:44:33 +01:00
parent 7e58d78bfe
commit 18dfd10b71
+3
View File
@@ -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) {