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
b162d97a
Commit
b162d97a
authored
May 05, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: plug a couple of leaks
parent
074d323f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/config_file.c
+7
-4
No files found.
src/config_file.c
View file @
b162d97a
...
...
@@ -1381,12 +1381,12 @@ static int parse_variable(struct reader *reader, char **var_name, char **var_val
quote_count
=
strip_comments
(
line
,
0
);
if
(
parse_name
(
var_name
,
&
value_start
,
reader
,
line
)
<
0
)
return
-
1
;
/* If there is no value, boolean true is assumed */
*
var_value
=
NULL
;
if
(
parse_name
(
var_name
,
&
value_start
,
reader
,
line
)
<
0
)
goto
on_error
;
/*
* Now, let's try to parse the value
*/
...
...
@@ -1835,7 +1835,10 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
write_data
.
preg
=
preg
;
write_data
.
value
=
value
;
if
((
result
=
config_parse
(
reader
,
write_on_section
,
write_on_variable
,
write_on_comment
,
write_on_eof
,
&
write_data
))
<
0
)
{
result
=
config_parse
(
reader
,
write_on_section
,
write_on_variable
,
write_on_comment
,
write_on_eof
,
&
write_data
);
git__free
(
section
);
if
(
result
<
0
)
{
git_filebuf_cleanup
(
&
file
);
goto
done
;
}
...
...
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