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
aebdbcd9
Commit
aebdbcd9
authored
Jan 08, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2811 from ethomson/remote_leak
remote: plug leak
parents
1646412d
365d3672
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/remote.c
+4
-4
tests/submodule/init.c
+5
-1
No files found.
src/remote.c
View file @
aebdbcd9
...
@@ -139,7 +139,7 @@ static int canonicalize_url(git_buf *out, const char *in)
...
@@ -139,7 +139,7 @@ static int canonicalize_url(git_buf *out, const char *in)
static
int
create_internal
(
git_remote
**
out
,
git_repository
*
repo
,
const
char
*
name
,
const
char
*
url
,
const
char
*
fetch
)
static
int
create_internal
(
git_remote
**
out
,
git_repository
*
repo
,
const
char
*
name
,
const
char
*
url
,
const
char
*
fetch
)
{
{
git_remote
*
remote
;
git_remote
*
remote
;
git_config
*
config
;
git_config
*
config
=
NULL
;
git_buf
canonical_url
=
GIT_BUF_INIT
,
fetchbuf
=
GIT_BUF_INIT
;
git_buf
canonical_url
=
GIT_BUF_INIT
,
fetchbuf
=
GIT_BUF_INIT
;
int
error
=
-
1
;
int
error
=
-
1
;
...
@@ -183,12 +183,12 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
...
@@ -183,12 +183,12 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
remote
->
download_tags
=
GIT_REMOTE_DOWNLOAD_TAGS_NONE
;
remote
->
download_tags
=
GIT_REMOTE_DOWNLOAD_TAGS_NONE
;
*
out
=
remote
;
*
out
=
remote
;
git_buf_free
(
&
fetchbuf
);
error
=
0
;
git_buf_free
(
&
canonical_url
);
return
0
;
on_error:
on_error:
if
(
error
)
git_remote_free
(
remote
);
git_remote_free
(
remote
);
git_config_free
(
config
);
git_config_free
(
config
);
git_buf_free
(
&
fetchbuf
);
git_buf_free
(
&
fetchbuf
);
git_buf_free
(
&
canonical_url
);
git_buf_free
(
&
canonical_url
);
...
...
tests/submodule/init.c
View file @
aebdbcd9
...
@@ -41,6 +41,7 @@ void test_submodule_init__absolute_url(void)
...
@@ -41,6 +41,7 @@ void test_submodule_init__absolute_url(void)
git_buf_free
(
&
absolute_url
);
git_buf_free
(
&
absolute_url
);
git_config_free
(
cfg
);
git_config_free
(
cfg
);
git_submodule_free
(
sm
);
}
}
void
test_submodule_init__relative_url
(
void
)
void
test_submodule_init__relative_url
(
void
)
...
@@ -70,6 +71,7 @@ void test_submodule_init__relative_url(void)
...
@@ -70,6 +71,7 @@ void test_submodule_init__relative_url(void)
git_buf_free
(
&
absolute_url
);
git_buf_free
(
&
absolute_url
);
git_config_free
(
cfg
);
git_config_free
(
cfg
);
git_submodule_free
(
sm
);
}
}
void
test_submodule_init__relative_url_detached_head
(
void
)
void
test_submodule_init__relative_url_detached_head
(
void
)
...
@@ -107,5 +109,7 @@ void test_submodule_init__relative_url_detached_head(void)
...
@@ -107,5 +109,7 @@ void test_submodule_init__relative_url_detached_head(void)
git_buf_free
(
&
absolute_url
);
git_buf_free
(
&
absolute_url
);
git_config_free
(
cfg
);
git_config_free
(
cfg
);
git_commit_free
(
head_commit
);
git_reference_free
(
head_ref
);
git_submodule_free
(
sm
);
}
}
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