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
ae26c4b8
Commit
ae26c4b8
authored
Nov 05, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1943 from libgit2/ntk/fix/leaks
Fix leaks
parents
c82f7f8e
61080a95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
src/config_file.c
+5
-2
tests-clar/diff/workdir.c
+2
-0
No files found.
src/config_file.c
View file @
ae26c4b8
...
@@ -1210,8 +1210,11 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
...
@@ -1210,8 +1210,11 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
write_start
=
data_start
;
write_start
=
data_start
;
/* Lock the file */
/* Lock the file */
if
((
result
=
git_filebuf_open
(
&
file
,
cfg
->
file_path
,
0
,
GIT_CONFIG_FILE_MODE
))
<
0
)
if
((
result
=
git_filebuf_open
(
return
result
;
&
file
,
cfg
->
file_path
,
0
,
GIT_CONFIG_FILE_MODE
))
<
0
)
{
git_buf_free
(
&
reader
->
buffer
);
return
result
;
}
skip_bom
(
reader
);
skip_bom
(
reader
);
ldot
=
strrchr
(
key
,
'.'
);
ldot
=
strrchr
(
key
,
'.'
);
...
...
tests-clar/diff/workdir.c
View file @
ae26c4b8
...
@@ -1477,6 +1477,8 @@ void test_diff_workdir__with_stale_index(void)
...
@@ -1477,6 +1477,8 @@ void test_diff_workdir__with_stale_index(void)
cl_git_pass
(
git_diff_foreach
(
cl_git_pass
(
git_diff_foreach
(
diff
,
diff_file_cb
,
diff_hunk_cb
,
diff_line_cb
,
&
exp
));
diff
,
diff_file_cb
,
diff_hunk_cb
,
diff_line_cb
,
&
exp
));
git_diff_free
(
diff
);
cl_assert_equal_i
(
16
,
exp
.
files
);
cl_assert_equal_i
(
16
,
exp
.
files
);
cl_assert_equal_i
(
0
,
exp
.
file_status
[
GIT_DELTA_ADDED
]);
cl_assert_equal_i
(
0
,
exp
.
file_status
[
GIT_DELTA_ADDED
]);
cl_assert_equal_i
(
3
,
exp
.
file_status
[
GIT_DELTA_DELETED
]);
cl_assert_equal_i
(
3
,
exp
.
file_status
[
GIT_DELTA_DELETED
]);
...
...
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