Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
b20c40a8
Commit
b20c40a8
authored
Nov 12, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leak memory when duplicating a NULL signature
parent
9db56cc4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
src/blame.c
+2
-4
src/signature.c
+5
-1
No files found.
src/blame.c
View file @
b20c40a8
...
...
@@ -76,10 +76,8 @@ static git_blame_hunk* dup_hunk(git_blame_hunk *hunk)
git_oid_cpy
(
&
newhunk
->
orig_commit_id
,
&
hunk
->
orig_commit_id
);
git_oid_cpy
(
&
newhunk
->
final_commit_id
,
&
hunk
->
final_commit_id
);
newhunk
->
boundary
=
hunk
->
boundary
;
if
(
hunk
->
final_signature
)
newhunk
->
final_signature
=
git_signature_dup
(
hunk
->
final_signature
);
if
(
hunk
->
orig_signature
)
newhunk
->
orig_signature
=
git_signature_dup
(
hunk
->
orig_signature
);
newhunk
->
final_signature
=
git_signature_dup
(
hunk
->
final_signature
);
newhunk
->
orig_signature
=
git_signature_dup
(
hunk
->
orig_signature
);
return
newhunk
;
}
...
...
src/signature.c
View file @
b20c40a8
...
...
@@ -84,8 +84,12 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
git_signature
*
git_signature_dup
(
const
git_signature
*
sig
)
{
git_signature
*
new
=
git__calloc
(
1
,
sizeof
(
git_signature
))
;
git_signature
*
new
;
if
(
sig
==
NULL
)
return
NULL
;
new
=
git__calloc
(
1
,
sizeof
(
git_signature
));
if
(
new
==
NULL
)
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment