git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Check return value of ftruncate call in http.c. Remove possible mem leak

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 10, 2009, 01:54 UTC
Message-ID
<7vljls5t7u.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1249709881-31334-1-git-send-email-jeff.lasslett@gmail.com>
Jeff Lasslett <jeff.lasslett@gmail.com> writes:
> In new_http_object_request(), check ftruncate() call return value and
> handle possible errors.  Remove possible leak of mem pointed to by url.

Are you assuming that everybody is running libcurl 7.17.0 or later? Before that version strings given to easy_setopt() were not copied and you needed to keep them around.

I think freeing url is fine but you would probably need to then give freq->url to easy_setopt(CURLOPT_URL) if you wanted to do so.

Previous: Jeff Lasslett
Message 2 of 2 in “Check return value of ftruncate call in http.c. Remove possible mem leak”
  1. Check return value of ftruncate call in http.c. Remove possible mem leakJeff Lasslett, Aug 8, 2009
  2. Junio C HamanoAug 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.