From: Omar Polo Subject: Re: Got Status Memory Leak pt. 3 To: Mark Jamsek Cc: Kyle Ackerman , gameoftrees@openbsd.org Date: Fri, 08 Dec 2023 09:08:55 +0100 On 2023/12/08 17:25:12 +1100, Mark Jamsek wrote: > Kyle Ackerman wrote: > > Here is the grand finale of this series. > > > > Here is the kdump from running `got status` > > > > [...] > > > > The got_pathlist_head never gets cleaned up in free_ignores(). The patch > > below will free it. While freeing the ignorelist in the TAILQ_FOREACH > > loop, the head of the list doesn't get freed. The puzzling part to me > > is that got_pathlist_free(ignores, GOT_PATHLIST_FREE_ALL) does not > > plug the leak, seems to reduce it though. But freeing it after the > > ignorelist seems to work. This patch has passed all regressions on my end. > > Thanks, Kyle! > > I see what you mean. This is because the GOT_PATHLIST_FREE_ALL flag > needs to be set on the second got_pathlist_free(ignores, ...) call in > free_ignores() as per the below diff, as it's the data pointer in the > ignores pathlist queue (i.e., pe->data in the loop) that is being leaked > and not the data pointer of the entries in the ignorelist queue. > > It's the same result either way so whichever diff is ok for me! I prefer to use the got_pathlist_free argument too since we have it, but ok op@ for either diff. Thanks!