Skip to content

Commit a152809

Browse files
peffgitster
authored andcommitted
http-push: free remote_ls_ctx.dentry_name
The remote_ls_ctx struct has dentry_name string, which is filled in with a heap allocation in the handle_remote_ls_ctx() XML callback. After the XML parse is done in remote_ls(), we should free the string to avoid a leak. This fixes several leaks found by running t5540. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94c6285 commit a152809

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

http-push.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,7 @@ static void remote_ls(const char *path, int flags,
11831183
}
11841184

11851185
free(ls.path);
1186+
free(ls.dentry_name);
11861187
free(url);
11871188
strbuf_release(&out_buffer.buf);
11881189
strbuf_release(&in_buffer);

0 commit comments

Comments
 (0)