Skip to content

Commit c270b05

Browse files
avargitster
authored andcommitted
submodule--helper: fix small memory leaks
Add a missing strbuf_release() and a clear_pathspec() to the submodule--helper. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27ff1fb commit c270b05

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,6 +3220,7 @@ static void die_on_index_match(const char *path, int force)
32203220
}
32213221
free(ps_matched);
32223222
}
3223+
clear_pathspec(&ps);
32233224
}
32243225

32253226
static void die_on_repo_without_commits(const char *path)
@@ -3231,6 +3232,7 @@ static void die_on_repo_without_commits(const char *path)
32313232
if (resolve_gitlink_ref(path, "HEAD", &oid) < 0)
32323233
die(_("'%s' does not have a commit checked out"), path);
32333234
}
3235+
strbuf_release(&sb);
32343236
}
32353237

32363238
static int module_add(int argc, const char **argv, const char *prefix)

0 commit comments

Comments
 (0)