summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-07-30 14:17:57 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-07-30 14:17:57 -0300
commitcff52c5423f9beabbbb857e16f1e36bba4efad8d (patch)
treea6373fa56f71b7d21bdb20910133bcd25df5b788 /git.c
parent2f74f1bd701788c3fe8bcb1d96ff8c5da1456986 (diff)
git: Make sure `f->name` is NULL before freeing `f` in
`parse_{comments,info}_file_path`
Diffstat (limited to 'git.c')
-rw-r--r--git.c2
1 files changed, 2 insertions, 0 deletions
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;
}