From 6eb6078bf5fd08028b21d80b9062a4aed83a2340 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 31 Mar 2016 17:35:44 -0700 Subject: abbrev_sha1_in_line: don't leak memory `split` is of type `struct strbuf **`, and currently we are leaking split itself as well as each element in split[i]. We have a dedicated free function for `struct strbuf **`, which takes care of freeing all related memory. Helped-by: Eric Sunshine Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- wt-status.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'wt-status.c') diff --git a/wt-status.c b/wt-status.c index bba25960b..9f4be333d 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1063,9 +1063,7 @@ static void abbrev_sha1_in_line(struct strbuf *line) strbuf_addf(line, "%s", split[i]->buf); } } - for (i = 0; split[i]; i++) - strbuf_release(split[i]); - + strbuf_list_free(split); } static void read_rebase_todolist(const char *fname, struct string_list *lines) -- cgit v1.2.1