{"thread":{"id":"14","subject":"Plug memory leak in update-cache.c","startedAt":"2005-04-14T08:53:50Z","lastAt":"2005-04-16T00:04:36Z","messageCount":4,"participants":["Martin Schlemmer","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56","messageId":"1113468830.23299.85.camel@nosferatu.lan","threadId":"14","inReplyTo":null,"subject":"Plug memory leak in update-cache.c","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-14T08:53:50Z","receivedAt":"2005-04-14T08:53:50Z","isPatch":false,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"Hi,\n\nMight not be that an big an issue as it should be freed on exit, but\nmight cause problems with big trees.\n\n----\n\nPlug memory leak in update-cache.c.\n\nSigned-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n\nupdate-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba\n--- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c\n+++ uncommitted/update-cache.c\n@@ -202,6 +202,7 @@\n                        printf(\"%s: needs update\\n\", ce->name);\n                        continue;\n                }\n+               free(active_cache[i]);\n                active_cache[i] = new;\n        }\n }\n\n\n-- \nMartin Schlemmer\n\n\n\nupdate-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba\n--- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c\n+++ uncommitted/update-cache.c\n@@ -202,6 +202,7 @@\n \t\t\tprintf(\"%s: needs update\\n\", ce->name);\n \t\t\tcontinue;\n \t\t}\n+\t\tfree(active_cache[i]);\n \t\tactive_cache[i] = new;\n \t}\n }\n"},{"id":"257","messageId":"20050415234807.GS7417@pasky.ji.cz","threadId":"14","inReplyTo":"1113468830.23299.85.camel@nosferatu.lan","subject":"Re: Plug memory leak in update-cache.c","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-15T23:48:07Z","receivedAt":"2005-04-15T23:48:07Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Apr 14, 2005 at 10:53:50AM CEST, I got a letter\nwhere Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> Hi,\n> \n> Might not be that an big an issue as it should be freed on exit, but\n> might cause problems with big trees.\n> \n> ----\n> \n> Plug memory leak in update-cache.c.\n> \n> Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> \n> update-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba\n> --- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c\n> +++ uncommitted/update-cache.c\n> @@ -202,6 +202,7 @@\n>                         printf(\"%s: needs update\\n\", ce->name);\n>                         continue;\n>                 }\n> +               free(active_cache[i]);\n>                 active_cache[i] = new;\n>         }\n>  }\n\nFYI, new could've contained active_cache[i] at that time, so you needed\nto check for that. Fixed though, thanks for pointing it out.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"260","messageId":"1113609621.8582.12.camel@nosferatu.lan","threadId":"14","inReplyTo":"20050415234807.GS7417@pasky.ji.cz","subject":"Re: Plug memory leak in update-cache.c","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-16T00:00:21Z","receivedAt":"2005-04-16T00:00:21Z","isPatch":false,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Sat, 2005-04-16 at 01:48 +0200, Petr Baudis wrote:\n> Dear diary, on Thu, Apr 14, 2005 at 10:53:50AM CEST, I got a letter\n> where Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> > Hi,\n> > \n> > Might not be that an big an issue as it should be freed on exit, but\n> > might cause problems with big trees.\n> > \n> > ----\n> > \n> > Plug memory leak in update-cache.c.\n> > \n> > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> > \n> > update-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba\n> > --- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c\n> > +++ uncommitted/update-cache.c\n> > @@ -202,6 +202,7 @@\n> >                         printf(\"%s: needs update\\n\", ce->name);\n> >                         continue;\n> >                 }\n> > +               free(active_cache[i]);\n> >                 active_cache[i] = new;\n> >         }\n> >  }\n> \n> FYI, new could've contained active_cache[i] at that time, so you needed\n> to check for that. Fixed though, thanks for pointing it out.\n> \n\nUrk, no, please drop.  As Ingo pointed out, the memory was obtained via\nmmap ...\n\n\n-- \nMartin Schlemmer\n\n"},{"id":"261","messageId":"20050416000436.GT7417@pasky.ji.cz","threadId":"14","inReplyTo":"1113609621.8582.12.camel@nosferatu.lan","subject":"Re: Re: Plug memory leak in update-cache.c","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-16T00:04:36Z","receivedAt":"2005-04-16T00:04:36Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sat, Apr 16, 2005 at 02:00:21AM CEST, I got a letter\nwhere Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> On Sat, 2005-04-16 at 01:48 +0200, Petr Baudis wrote:\n> > Dear diary, on Thu, Apr 14, 2005 at 10:53:50AM CEST, I got a letter\n> > where Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> > > Hi,\n> > > \n> > > Might not be that an big an issue as it should be freed on exit, but\n> > > might cause problems with big trees.\n> > > \n> > > ----\n> > > \n> > > Plug memory leak in update-cache.c.\n> > > \n> > > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> > > \n> > > update-cache.c:  22f3ccd47db4f0888901109a8cbf883d272d1cba\n> > > --- 22f3ccd47db4f0888901109a8cbf883d272d1cba/update-cache.c\n> > > +++ uncommitted/update-cache.c\n> > > @@ -202,6 +202,7 @@\n> > >                         printf(\"%s: needs update\\n\", ce->name);\n> > >                         continue;\n> > >                 }\n> > > +               free(active_cache[i]);\n> > >                 active_cache[i] = new;\n> > >         }\n> > >  }\n> > \n> > FYI, new could've contained active_cache[i] at that time, so you needed\n> > to check for that. Fixed though, thanks for pointing it out.\n> > \n> \n> Urk, no, please drop.  As Ingo pointed out, the memory was obtained via\n> mmap ...\n\nYes, I've just noticed that. ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"}]}