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
68166017
Unverified
Commit
68166017
authored
Jan 20, 2019
by
Edward Thomson
Committed by
GitHub
Jan 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4948 from libgit2/ethomson/memleaks
repository: free memory in symlink detection function
parents
1e92a036
b8b796c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/repository.c
+8
-5
No files found.
src/repository.c
View file @
68166017
...
...
@@ -1415,6 +1415,10 @@ static bool is_filesystem_case_insensitive(const char *gitdir_path)
static
bool
are_symlinks_supported
(
const
char
*
wd_path
)
{
git_config
*
config
=
NULL
;
git_buf
global_buf
=
GIT_BUF_INIT
;
git_buf
xdg_buf
=
GIT_BUF_INIT
;
git_buf
system_buf
=
GIT_BUF_INIT
;
git_buf
programdata_buf
=
GIT_BUF_INIT
;
git_buf
path
=
GIT_BUF_INIT
;
int
fd
;
struct
stat
st
;
...
...
@@ -1428,11 +1432,6 @@ static bool are_symlinks_supported(const char *wd_path)
* _not_ set, then we do not test or enable symlink support.
*/
#ifdef GIT_WIN32
git_buf
global_buf
=
GIT_BUF_INIT
;
git_buf
xdg_buf
=
GIT_BUF_INIT
;
git_buf
system_buf
=
GIT_BUF_INIT
;
git_buf
programdata_buf
=
GIT_BUF_INIT
;
git_config_find_global
(
&
global_buf
);
git_config_find_xdg
(
&
xdg_buf
);
git_config_find_system
(
&
system_buf
);
...
...
@@ -1461,6 +1460,10 @@ static bool are_symlinks_supported(const char *wd_path)
(
void
)
p_unlink
(
path
.
ptr
);
done:
git_buf_dispose
(
&
global_buf
);
git_buf_dispose
(
&
xdg_buf
);
git_buf_dispose
(
&
system_buf
);
git_buf_dispose
(
&
programdata_buf
);
git_buf_dispose
(
&
path
);
git_config_free
(
config
);
return
symlinks
!=
0
;
...
...
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