summaryrefslogtreecommitdiff
path: root/trace.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-01-04 10:04:01 -0800
committerJunio C Hamano <gitster@pobox.com>2017-01-08 18:04:17 -0800
commit8aee769fa12ff0d3a4100c3d0359bc33e49db672 (patch)
tree1cfba92290690678c337d37cbe7c4247ed0e7cae /trace.c
parent34305f7753f9f044cb280e6d58658cb31b140693 (diff)
downloadgit-8aee769fa12ff0d3a4100c3d0359bc33e49db672.tar.gz
pathspec: copy and free owned memory
The 'original' string entry in a pathspec_item is only duplicated some of the time, instead always make a copy of the original and take ownership of the memory. Since both 'match' and 'original' string entries in a pathspec_item are owned by the pathspec struct, they need to be freed when clearing the pathspec struct (in 'clear_pathspec()') and duplicated when copying the pathspec struct (in 'copy_pathspec()'). Also change the type of 'match' and 'original' to 'char *' in order to more explicitly show the ownership of the memory. Signed-off-by: Brandon Williams <bmwill@google.com> Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.c')
0 files changed, 0 insertions, 0 deletions