Commit a88fdda676b5f58f0ccec69a67f32d710d4676e8

Edward Thomson 2021-09-02T22:36:46

Merge pull request #6029 from arroz/fix_6028 #6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/threadstate.c b/src/threadstate.c
index 6031e82..e2c0897 100644
--- a/src/threadstate.c
+++ b/src/threadstate.c
@@ -36,7 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
 	if (!threadstate)
 		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;
 }