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.
1 parent 72d0024 commit 1ba48b7Copy full SHA for 1ba48b7
src/notes.c
@@ -313,6 +313,7 @@ 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);
@@ -323,11 +324,10 @@ static int note_new(
323
324
git_signature_dup(¬e->committer, git_commit_committer(commit)) < 0)
325
return -1;
326
- note->message = git__strdup((char *)git_blob_rawcontent(blob));
327
- GITERR_CHECK_ALLOC(note->message);
+ git_buf_put(¬e_contents, git_blob_rawcontent(blob), git_blob_rawsize(blob));
328
+ note->message = git_buf_detach(¬e_contents);
329
330
*out = note;
-
331
return 0;
332
}
333
0 commit comments