From: Niels Provos Date: Tue, 31 Jul 2007 00:32:00 +0000 (+0000) Subject: fix memory leak; found by Elliot F X-Git-Tag: release-2.0.1-alpha~603 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7ff0248c7993bf1b437598f53ce7ec56a0f2bdb;p=libevent fix memory leak; found by Elliot F svn:r378 --- diff --git a/http.c b/http.c index d093da82..635350f7 100644 --- a/http.c +++ b/http.c @@ -641,8 +641,10 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf) if (p == NULL) break; /* the last chunk is on a new line? */ - if (strlen(p) == 0) + if (strlen(p) == 0) { + free(p); continue; + } req->ntoread = strtol(p, &endp, 16); error = *p == '\0' || (*endp != '\0' && *endp != ' '); free(p);