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
ecd55cec
Unverified
Commit
ecd55cec
authored
Jan 17, 2018
by
Carlos Martín Nieto
Committed by
GitHub
Jan 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4477 from pks-t/pks/memleaks
Memory leaks
parents
f1323d9c
782402c2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
include/git2/refs.h
+3
-0
src/transports/local.c
+2
-0
tests/network/fetchlocal.c
+0
-8
tests/refs/iterator.c
+1
-0
No files found.
include/git2/refs.h
View file @
ecd55cec
...
...
@@ -433,6 +433,9 @@ typedef int (*git_reference_foreach_name_cb)(const char *name, void *payload);
* passed to this method. Returning a non-zero value from the callback
* will terminate the iteration.
*
* Note that the callback function is responsible to call `git_reference_free`
* on each reference passed to it.
*
* @param repo Repository where to find the refs
* @param callback Function which will be called for every listed ref
* @param payload Additional data to pass to the callback
...
...
src/transports/local.c
View file @
ecd55cec
...
...
@@ -519,6 +519,8 @@ static int foreach_reference_cb(git_reference *reference, void *payload)
error
=
0
;
}
git_reference_free
(
reference
);
return
error
;
}
...
...
tests/network/fetchlocal.c
View file @
ecd55cec
...
...
@@ -314,12 +314,6 @@ void test_network_fetchlocal__prune_tag(void)
git_repository_free
(
repo
);
}
static
void
cleanup_sandbox
(
void
*
unused
)
{
GIT_UNUSED
(
unused
);
cl_git_sandbox_cleanup
();
}
void
test_network_fetchlocal__partial
(
void
)
{
git_repository
*
repo
=
cl_git_sandbox_init
(
"partial-testrepo"
);
...
...
@@ -332,7 +326,6 @@ void test_network_fetchlocal__partial(void)
options
.
callbacks
.
transfer_progress
=
transfer_cb
;
options
.
callbacks
.
payload
=
&
callcount
;
cl_set_cleanup
(
&
cleanup_sandbox
,
NULL
);
cl_git_pass
(
git_reference_list
(
&
refnames
,
repo
));
cl_assert_equal_i
(
1
,
(
int
)
refnames
.
count
);
...
...
@@ -420,7 +413,6 @@ void test_network_fetchlocal__multi_remotes(void)
git_strarray
refnames
=
{
0
};
git_fetch_options
options
=
GIT_FETCH_OPTIONS_INIT
;
cl_set_cleanup
(
&
cleanup_sandbox
,
NULL
);
options
.
callbacks
.
transfer_progress
=
transfer_cb
;
cl_git_pass
(
git_remote_set_url
(
repo
,
"test"
,
cl_git_fixture_url
(
"testrepo.git"
)));
cl_git_pass
(
git_remote_lookup
(
&
test
,
repo
,
"test"
));
...
...
tests/refs/iterator.c
View file @
ecd55cec
...
...
@@ -213,6 +213,7 @@ void test_refs_iterator__foreach_name(void)
git_vector_foreach
(
&
output
,
i
,
name
)
{
cl_assert
(
refnames
[
i
]
!=
NULL
);
cl_assert_equal_s
(
refnames
[
i
],
name
);
git__free
(
name
);
}
git_vector_free
(
&
output
);
...
...
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