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
9f7f4122
Commit
9f7f4122
authored
Mar 29, 2011
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leak if config parsing fails
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent
4e02504f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/config.c
+8
-3
No files found.
src/config.c
View file @
9f7f4122
...
...
@@ -74,15 +74,20 @@ int git_config_open(git_config **cfg_out, const char *path)
goto
cleanup
;
}
*
cfg_out
=
cfg
;
error
=
gitfo_read_file
(
&
cfg
->
reader
.
buffer
,
cfg
->
file_path
);
if
(
error
<
GIT_SUCCESS
)
goto
cleanup
;
/* Initialise the reading position */
cfg
->
reader
.
read_ptr
=
cfg
->
reader
.
buffer
.
data
;
return
config_parse
(
cfg
);
error
=
config_parse
(
cfg
);
if
(
error
<
GIT_SUCCESS
)
git_config_free
(
cfg
);
else
*
cfg_out
=
cfg
;
return
error
;
cleanup:
if
(
cfg
->
vars
)
...
...
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