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
7849e467
Commit
7849e467
authored
May 02, 2017
by
Edward Thomson
Committed by
GitHub
May 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4229 from pks-t/pks/ssh-memleaks
libssh2 shutdown
parents
9cc0ba6b
2ce2a48f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
src/global.c
+1
-1
src/transports/ssh.c
+13
-1
No files found.
src/global.c
View file @
7849e467
...
...
@@ -22,7 +22,7 @@
git_mutex
git__mwindow_mutex
;
#define MAX_SHUTDOWN_CB
8
#define MAX_SHUTDOWN_CB
9
static
git_global_shutdown_fn
git__shutdown_callbacks
[
MAX_SHUTDOWN_CB
];
static
git_atomic
git__n_shutdown_callbacks
;
...
...
src/transports/ssh.c
View file @
7849e467
...
...
@@ -9,6 +9,7 @@
#include <libssh2.h>
#endif
#include "global.h"
#include "git2.h"
#include "buffer.h"
#include "netops.h"
...
...
@@ -893,11 +894,22 @@ int git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *p
#endif
}
#ifdef GIT_SSH
static
void
shutdown_ssh
(
void
)
{
libssh2_exit
();
}
#endif
int
git_transport_ssh_global_init
(
void
)
{
#ifdef GIT_SSH
if
(
libssh2_init
(
0
)
<
0
)
{
giterr_set
(
GITERR_SSH
,
"unable to initialize libssh2"
);
return
-
1
;
}
libssh2_init
(
0
);
git__on_shutdown
(
shutdown_ssh
);
return
0
;
#else
...
...
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