Commit 2357890
preload-index: fix memleak
Fix a memory leak occuring in case of pathspec copy in preload_index.
Direct leak of 8 byte(s) in 8 object(s) allocated from:
#0 0x7f0a353ead47 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/libasan.so.6+0xb5d47)
helmo#1 0x55750995e840 in do_xmalloc /home/anthony/src/c/git/wrapper.c:51
helmo#2 0x55750995e840 in xmalloc /home/anthony/src/c/git/wrapper.c:72
helmo#3 0x55750970f824 in copy_pathspec /home/anthony/src/c/git/pathspec.c:684
#4 0x557509717278 in preload_index /home/anthony/src/c/git/preload-index.c:135
#5 0x55750975f21e in refresh_index /home/anthony/src/c/git/read-cache.c:1633
git#6 0x55750915b926 in cmd_status builtin/commit.c:1547
#7 0x5575090e1680 in run_builtin /home/anthony/src/c/git/git.c:466
git#8 0x5575090e1680 in handle_builtin /home/anthony/src/c/git/git.c:720
git#9 0x5575090e284a in run_argv /home/anthony/src/c/git/git.c:787
git#10 0x5575090e284a in cmd_main /home/anthony/src/c/git/git.c:920
git#11 0x5575090dbf82 in main /home/anthony/src/c/git/common-main.c:56
git#12 0x7f0a348230ab (/lib64/libc.so.6+0x290ab)
Signed-off-by: Anthony Delannoy <anthony.2lannoy@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 359da65 commit 2357890
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
0 commit comments