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
f5c874a4
Commit
f5c874a4
authored
Mar 29, 2016
by
Carlos Martín Nieto
Committed by
Edward Thomson
Mar 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug a few leaks
parent
1694a639
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
src/iterator.c
+14
-0
src/tree.c
+2
-0
tests/core/array.c
+2
-0
No files found.
src/iterator.c
View file @
f5c874a4
...
@@ -667,6 +667,7 @@ done:
...
@@ -667,6 +667,7 @@ done:
static
void
tree_iterator_frame_pop
(
tree_iterator
*
iter
)
static
void
tree_iterator_frame_pop
(
tree_iterator
*
iter
)
{
{
tree_iterator_frame
*
frame
;
tree_iterator_frame
*
frame
;
git_buf
*
buf
=
NULL
;
assert
(
iter
->
frames
.
size
);
assert
(
iter
->
frames
.
size
);
...
@@ -674,6 +675,14 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
...
@@ -674,6 +675,14 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
git_vector_free
(
&
frame
->
entries
);
git_vector_free
(
&
frame
->
entries
);
git_tree_free
(
frame
->
tree
);
git_tree_free
(
frame
->
tree
);
do
{
buf
=
git_array_pop
(
frame
->
similar_paths
);
git_buf_free
(
buf
);
}
while
(
buf
!=
NULL
);
git_array_clear
(
frame
->
similar_paths
);
git_buf_free
(
&
frame
->
path
);
}
}
static
int
tree_iterator_current
(
static
int
tree_iterator_current
(
...
@@ -1760,6 +1769,10 @@ static int filesystem_iterator_reset(git_iterator *i)
...
@@ -1760,6 +1769,10 @@ static int filesystem_iterator_reset(git_iterator *i)
static
void
filesystem_iterator_free
(
git_iterator
*
i
)
static
void
filesystem_iterator_free
(
git_iterator
*
i
)
{
{
filesystem_iterator
*
iter
=
(
filesystem_iterator
*
)
i
;
filesystem_iterator
*
iter
=
(
filesystem_iterator
*
)
i
;
git__free
(
iter
->
root
);
git_buf_free
(
&
iter
->
current_path
);
if
(
iter
->
index
)
git_index_snapshot_release
(
&
iter
->
index_snapshot
,
iter
->
index
);
filesystem_iterator_clear
(
iter
);
filesystem_iterator_clear
(
iter
);
}
}
...
@@ -1823,6 +1836,7 @@ static int iterator_for_filesystem(
...
@@ -1823,6 +1836,7 @@ static int iterator_for_filesystem(
(
error
=
git_index_snapshot_new
(
&
iter
->
index_snapshot
,
index
))
<
0
)
(
error
=
git_index_snapshot_new
(
&
iter
->
index_snapshot
,
index
))
<
0
)
goto
on_error
;
goto
on_error
;
iter
->
index
=
index
;
iter
->
dirload_flags
=
iter
->
dirload_flags
=
(
iterator__ignore_case
(
&
iter
->
base
)
?
GIT_PATH_DIR_IGNORE_CASE
:
0
)
|
(
iterator__ignore_case
(
&
iter
->
base
)
?
GIT_PATH_DIR_IGNORE_CASE
:
0
)
|
(
iterator__flag
(
&
iter
->
base
,
PRECOMPOSE_UNICODE
)
?
(
iterator__flag
(
&
iter
->
base
,
PRECOMPOSE_UNICODE
)
?
...
...
src/tree.c
View file @
f5c874a4
...
@@ -837,6 +837,8 @@ int git_treebuilder_write(git_oid *oid, git_treebuilder *bld)
...
@@ -837,6 +837,8 @@ int git_treebuilder_write(git_oid *oid, git_treebuilder *bld)
error
=
git_odb_write
(
oid
,
odb
,
tree
.
ptr
,
tree
.
size
,
GIT_OBJ_TREE
);
error
=
git_odb_write
(
oid
,
odb
,
tree
.
ptr
,
tree
.
size
,
GIT_OBJ_TREE
);
git_buf_free
(
&
tree
);
git_buf_free
(
&
tree
);
git_vector_free
(
&
entries
);
return
error
;
return
error
;
}
}
...
...
tests/core/array.c
View file @
f5c874a4
...
@@ -51,5 +51,7 @@ void test_core_array__bsearch2(void)
...
@@ -51,5 +51,7 @@ void test_core_array__bsearch2(void)
expect_pos
(
50
,
10
,
GIT_ENOTFOUND
);
expect_pos
(
50
,
10
,
GIT_ENOTFOUND
);
expect_pos
(
68
,
10
,
GIT_ENOTFOUND
);
expect_pos
(
68
,
10
,
GIT_ENOTFOUND
);
expect_pos
(
256
,
12
,
GIT_OK
);
expect_pos
(
256
,
12
,
GIT_OK
);
git_array_clear
(
integers
);
}
}
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