FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing. by arroz · Pull Request #6029 · libgit2/libgit2 · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 2 additions & 1 deletion src/threadstate.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment on lines +39 to +40

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM - just a quick whitespace fix:

Suggested change
if (threadstate->error_t.message != git_buf__initbuf)
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;
}

Expand Down

Back | FazBrowse Home | New Git URL