From cff52c5423f9beabbbb857e16f1e36bba4efad8d Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 30 Jul 2022 14:17:57 -0300 Subject: git: Make sure `f->name` is NULL before freeing `f` in `parse_{comments,info}_file_path` --- git.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git.c b/git.c index 47cb186..70be9a2 100644 --- a/git.c +++ b/git.c @@ -272,6 +272,7 @@ static int parse_info_file(pull_request *pr, char *buf, const char *root) { static int parse_comments_file_path(comment ***comments, const char *root) { file *f = create_file(root, "comments"); int ret = parse_comments_file(comments, f->buf); + f->name = NULL; free_file(f); return ret; } @@ -279,6 +280,7 @@ static int parse_comments_file_path(comment ***comments, const char *root) { static int parse_info_file_path(pull_request *pr, const char *root) { file *f = create_file(root, "info"); int ret = parse_info_file(pr, f->buf, root); + f->name = NULL; free_file(f); return ret; } -- cgit v1.2.3-13-gbd6f