]> granicus.if.org Git - libevent/commitdiff
fix memory leak; found by Elliot F
authorNiels Provos <provos@gmail.com>
Tue, 31 Jul 2007 00:32:00 +0000 (00:32 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 31 Jul 2007 00:32:00 +0000 (00:32 +0000)
svn:r378

http.c

diff --git a/http.c b/http.c
index d093da82067ced8e7ca2c9a8d5ff6f73e2946337..635350f782dbf8ffcc6a844466a4394732f94075 100644 (file)
--- 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);