]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- fixed memory leak: "prefix_p = xmalloc(prefix_sz + 1);" was no freed
authorrousskov <>
Thu, 28 May 1998 11:12:58 +0000 (11:12 +0000)
committerrousskov <>
Thu, 28 May 1998 11:12:58 +0000 (11:12 +0000)
  in most cases.

src/client_side.cc

index 29e398e8722774ee8b8554f9c084474ba52a913a..21de1d25f89980330a69dd09c13d165aecb07396 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.317 1998/05/27 22:51:49 rousskov Exp $
+ * $Id: client_side.cc,v 1.318 1998/05/28 05:12:58 rousskov Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -2098,6 +2098,8 @@ clientReadRequest(int fd, void *data)
            &parser_return_code,
            &prefix,
            &req_line_sz);
+       if (!http)
+           safe_free(prefix);
        if (http) {
            assert(http->req_sz > 0);
            conn->in.offset -= http->req_sz;
@@ -2119,6 +2121,7 @@ clientReadRequest(int fd, void *data)
                err->request_hdrs = xstrdup(conn->in.buf);
                http->entry = clientCreateStoreEntry(http, method, 0);
                errorAppendEntry(http->entry, err);
+               safe_free(prefix);
                break;
            }
            if ((request = urlParse(method, http->uri)) == NULL) {
@@ -2151,6 +2154,7 @@ clientReadRequest(int fd, void *data)
                    }
                }
            }
+           safe_free(prefix);
            safe_free(http->log_uri);
            http->log_uri = xstrdup(urlCanonicalClean(request));
            request->client_addr = conn->peer.sin_addr;