{"thread":{"id":"22451","subject":"[PATCH 2/3] grep: Fix two memory leaks","startedAt":"2010-01-30T15:42:58Z","lastAt":"2010-01-30T15:45:53Z","messageCount":2,"participants":["Dan McGee"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"133116","messageId":"1264866178-12048-1-git-send-email-dpmcgee@gmail.com","threadId":"22451","inReplyTo":null,"subject":"[PATCH 2/3] grep: Fix two memory leaks","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-01-30T15:42:58Z","receivedAt":"2010-01-30T15:42:58Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"We duplicate the grep_opt structure when using grep threads, but didn't\nlater free either the patterns attached to this new structure or the\nstructure itself.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\nFound these with valgrind.\n\n-Dan\n\n builtin-grep.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 9bd467c..0ef849c 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -205,6 +205,8 @@ static void *run(void *arg)\n \n \t\twork_done(w);\n \t}\n+\tfree_grep_patterns(arg);\n+\tfree(arg);\n \n \treturn (void*) (intptr_t) hit;\n }\n-- \n1.6.6.1\n"},{"id":"133117","messageId":"449c10961001300745m495986acw5f1cfe5c22f4ee1f@mail.gmail.com","threadId":"22451","inReplyTo":"1264866178-12048-1-git-send-email-dpmcgee@gmail.com","subject":"Re: [PATCH 2/3] grep: Fix two memory leaks","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-01-30T15:45:53Z","receivedAt":"2010-01-30T15:45:53Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Sat, Jan 30, 2010 at 9:42 AM, Dan McGee <dpmcgee@gmail.com> wrote:\n> We duplicate the grep_opt structure when using grep threads, but didn't\n> later free either the patterns attached to this new structure or the\n> structure itself.\n>\n> Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n> ---\n> Found these with valgrind.\n\nIgnore the misleading numbers in the subject, there isn't more to see\nhere...whoops.\n\n-Dan\n"}]}