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

Re: [PATCH] builtin-clone.c: fix memory leak in cmd_clone()

From
ARAli Gholami Rudi <ali@rudi.ir>
Date
Apr 1, 2009, 20:17 UTC
Message-ID
<20090401201704.GA2237@lilem.mirepesht>
In-Reply-To
<7v3acs1gyf.fsf@gitster.siamese.dyndns.org>
Hi,
Junio C Hamano <gitster@pobox.com> wrote:
> Yup, I'll queue (I won't have time today to work on git it seems) the
Thanks.
> other two patches from you, but I was going to drop this one---unless your
> plan was to make cmd_clone() callable more than once in order to use it in
> say a C rewrite of git submodule or something like that.

The only problem in builtin-clone.c seems to be remove_junk() which is called from a signal handler or atexit(). cmd_clone() can be changed to register this function only once.

remove_junk() uses junk_* global variables which are overwritten in each cmd_clone() call. Since no concurrent cmd_clone() is allowed (?) and we only care about the last one, this does not seem to be an issue.

I'll probably send a new patch tomorrow.

Regards, Ali

Previous: Junio C Hamano
Message 5 of 5 in “builtin-clone.c: fix memory leak in cmd_clone()”
  1. builtin-clone.c: fix memory leak in cmd_clone()Ali Gholami Rudi, Apr 1, 2009
  2. Johannes SchindelinApr 1, 2009
  3. Ali Gholami RudiApr 1, 2009
  4. Junio C HamanoApr 1, 2009
  5. Ali Gholami RudiApr 1, 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.