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

Re: Plug memory leak in update-cache.c

From
MSMartin Schlemmer <azarah@nosferatu.za.org>
Date
Apr 16, 2005, 00:00 UTC
Message-ID
<1113609621.8582.12.camel@nosferatu.lan>
In-Reply-To
<20050415234807.GS7417@pasky.ji.cz>
On Sat, 2005-04-16 at 01:48 +0200, Petr Baudis wrote:
Show 28 quoted lines
> Dear diary, on Thu, Apr 14, 2005 at 10:53:50AM CEST, I got a letter
> where Martin Schlemmer <azarah@nosferatu.za.org> told me that...
> > Hi,
> > 
> > Might not be that an big an issue as it should be freed on exit, but
> > might cause problems with big trees.
> > 
> > ----
> > 
> > Plug memory leak in update-cache.c.
> > 
> > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>
> > 
> > update-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba
> > --- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c
> > +++ uncommitted/update-cache.c
> > @@ -202,6 +202,7 @@
> >                         printf("%s: needs update\n", ce->name);
> >                         continue;
> >                 }
> > +               free(active_cache[i]);
> >                 active_cache[i] = new;
> >         }
> >  }
> 
> FYI, new could've contained active_cache[i] at that time, so you needed
> to check for that. Fixed though, thanks for pointing it out.
> 

Urk, no, please drop. As Ingo pointed out, the memory was obtained via mmap ...

-- 
Martin Schlemmer
Previous: Petr BaudisNext: Petr Baudis
Message 3 of 4 in “Plug memory leak in update-cache.c”
  1. Martin SchlemmerApr 14, 2005
  2. Petr BaudisApr 15, 2005
  3. Martin SchlemmerApr 16, 2005
  4. Petr BaudisApr 16, 2005

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.