mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-24 15:59:01 +00:00
notes: Use git__strndup
This commit is contained in:
parent
2e1e0f108f
commit
b7fb71e39c
@ -313,7 +313,6 @@ static int note_new(
|
||||
git_blob *blob)
|
||||
{
|
||||
git_note *note = NULL;
|
||||
git_buf note_contents = GIT_BUF_INIT;
|
||||
|
||||
note = (git_note *)git__malloc(sizeof(git_note));
|
||||
GITERR_CHECK_ALLOC(note);
|
||||
@ -324,8 +323,8 @@ static int note_new(
|
||||
git_signature_dup(¬e->committer, git_commit_committer(commit)) < 0)
|
||||
return -1;
|
||||
|
||||
git_buf_put(¬e_contents, git_blob_rawcontent(blob), git_blob_rawsize(blob));
|
||||
note->message = git_buf_detach(¬e_contents);
|
||||
note->message = git__strndup(git_blob_rawcontent(blob), git_blob_rawsize(blob));
|
||||
GITERR_CHECK_ALLOC(note->message);
|
||||
|
||||
*out = note;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user