diff options
author | Nicolas Guichard <nicolas@guichard.eu> | 2024-10-09 07:58:18 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-10-09 10:52:44 -0700 |
commit | e4d03b79386e3bd0dba1c8096f8602490bda99d6 (patch) | |
tree | 68f02a74edb7e46caa3aa81c6532639b5960e46f /builtin/annotate.c | |
parent | 777489f9e09c8d0dd6b12f9d90de6376330577a2 (diff) |
load_branch_decorations: fix memory leak with non-static filters
load_branch_decorations calls normalize_glob_ref on each string of filter's
string_lists. This effectively replaces the potentially non-owning char* of
those items with an owning char*.
Set the strdup_string flag on those string_lists.
This was not caught until now because:
- when passing string_lists already with the strdup_string already set, the
behaviour was correct
- when passing static string_lists, the new char* remain reachable until
program exit
Signed-off-by: Nicolas Guichard <nicolas@guichard.eu>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/annotate.c')
0 files changed, 0 insertions, 0 deletions