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 <sunshine@sunshineco.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
344b548475
commit
6eb6078bf5
|
@ -1063,9 +1063,7 @@ static void abbrev_sha1_in_line(struct strbuf *line)
|
||||||
strbuf_addf(line, "%s", split[i]->buf);
|
strbuf_addf(line, "%s", split[i]->buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; split[i]; i++)
|
strbuf_list_free(split);
|
||||||
strbuf_release(split[i]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_rebase_todolist(const char *fname, struct string_list *lines)
|
static void read_rebase_todolist(const char *fname, struct string_list *lines)
|
||||||
|
|
Loading…
Reference in New Issue