Commit 27f50a66 by Miguel Arroz

#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing.

This follows the same principle as `buffer.c` where the same check is done before freeing the buffer. It fixes the crash described in #6028.
parent 4fd32be0
...@@ -36,7 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate) ...@@ -36,7 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
if (!threadstate) if (!threadstate)
return; return;
git__free(threadstate->error_t.message); if (threadstate->error_t.message != git_buf__initbuf)
git__free(threadstate->error_t.message);
threadstate->error_t.message = NULL; threadstate->error_t.message = NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment