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
966fb207
Commit
966fb207
authored
Jun 25, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree: free in error conditions
As reported by coverity, we would leak some memory in error conditions.
parent
5e0f47c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/tree.c
+2
-0
No files found.
src/tree.c
View file @
966fb207
...
@@ -466,6 +466,7 @@ static int append_entry(
...
@@ -466,6 +466,7 @@ static int append_entry(
git_strmap_insert
(
bld
->
map
,
entry
->
filename
,
entry
,
error
);
git_strmap_insert
(
bld
->
map
,
entry
->
filename
,
entry
,
error
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
git_tree_entry_free
(
entry
);
giterr_set
(
GITERR_TREE
,
"failed to append entry %s to the tree builder"
,
filename
);
giterr_set
(
GITERR_TREE
,
"failed to append entry %s to the tree builder"
,
filename
);
return
-
1
;
return
-
1
;
}
}
...
@@ -622,6 +623,7 @@ int git_treebuilder_create(git_treebuilder **builder_p, const git_tree *source)
...
@@ -622,6 +623,7 @@ int git_treebuilder_create(git_treebuilder **builder_p, const git_tree *source)
GITERR_CHECK_ALLOC
(
bld
);
GITERR_CHECK_ALLOC
(
bld
);
if
(
git_strmap_alloc
(
&
bld
->
map
)
<
0
)
{
if
(
git_strmap_alloc
(
&
bld
->
map
)
<
0
)
{
git__free
(
bld
);
return
-
1
;
return
-
1
;
}
}
...
...
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