Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
git__strndup
1 parent 2e1e0f1 commit b7fb71eCopy full SHA for b7fb71e
src/notes.c
@@ -313,7 +313,6 @@ static int note_new(
313
git_blob *blob)
314
{
315
git_note *note = NULL;
316
- git_buf note_contents = GIT_BUF_INIT;
317
318
note = (git_note *)git__malloc(sizeof(git_note));
319
GITERR_CHECK_ALLOC(note);
@@ -324,8 +323,8 @@ static int note_new(
324
323
git_signature_dup(¬e->committer, git_commit_committer(commit)) < 0)
325
return -1;
326
327
- git_buf_put(¬e_contents, git_blob_rawcontent(blob), git_blob_rawsize(blob));
328
- note->message = git_buf_detach(¬e_contents);
+ note->message = git__strndup(git_blob_rawcontent(blob), git_blob_rawsize(blob));
+ GITERR_CHECK_ALLOC(note->message);
329
330
*out = note;
331
return 0;
0 commit comments