Skip to content

Commit a88fdda

Browse files
authored
Merge pull request libgit2#6029 from arroz/fix_6028
libgit2#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing.
2 parents 4fd32be + 27f50a6 commit a88fdda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/threadstate.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
3636
if (!threadstate)
3737
return;
3838

39-
git__free(threadstate->error_t.message);
39+
if (threadstate->error_t.message != git_buf__initbuf)
40+
git__free(threadstate->error_t.message);
4041
threadstate->error_t.message = NULL;
4142
}
4243

0 commit comments

Comments
 (0)