mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Fix potential crash when saved_git_id is NULL
We have a safe strdup alternative. Let's just use it. Fixes #2220 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7eadc8ef7e
commit
e9194a5c40
1 changed files with 1 additions and 1 deletions
|
@ -264,7 +264,7 @@ int check_git_sha(const char *filename, struct git_repository **git_p, const cha
|
|||
struct git_repository *git;
|
||||
const char *branch = NULL;
|
||||
|
||||
char *current_sha = strdup(saved_git_id);
|
||||
char *current_sha = copy_string(saved_git_id);
|
||||
git = is_git_repository(filename, &branch, NULL, false);
|
||||
if (git_p)
|
||||
*git_p = git;
|
||||
|
|
Loading…
Reference in a new issue