From 535d691a4ad7715c5e46c90d854c768923f4932b Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Wed, 8 Sep 2010 19:19:17 +0200 Subject: [PATCH] Fix full_uri memory leak in error path --- src/httpd_daap.c | 1 + src/httpd_dacp.c | 1 + src/httpd_rsp.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index a4d9fb00..7c094025 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -2971,6 +2971,7 @@ daap_request(struct evhttp_request *req) uri = strdup(full_uri); if (!uri) { + free(full_uri); evhttp_send_error(req, HTTP_BADREQUEST, "Bad Request"); return; } diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 419cfd04..59b025b5 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1613,6 +1613,7 @@ dacp_request(struct evhttp_request *req) uri = strdup(full_uri); if (!uri) { + free(full_uri); evhttp_send_error(req, HTTP_BADREQUEST, "Bad Request"); return; } diff --git a/src/httpd_rsp.c b/src/httpd_rsp.c index 0fc62394..ec5affe1 100644 --- a/src/httpd_rsp.c +++ b/src/httpd_rsp.c @@ -839,6 +839,8 @@ rsp_request(struct evhttp_request *req) if (!uri) { rsp_send_error(req, "Server error"); + + free(full_uri); return; }