Skip to content

Commit 0ddc077

Browse files
committed
Merge branch 'v1.7_backports' into maint/v1.7
2 parents 3e2baa6 + ec2439b commit 0ddc077

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

include/git2/sys/transport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define INCLUDE_sys_git_transport_h
1010

1111
#include "git2/net.h"
12+
#include "git2/oidarray.h"
1213
#include "git2/proxy.h"
1314
#include "git2/remote.h"
1415
#include "git2/strarray.h"

src/libgit2/repository.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ int git_repository__cleanup(git_repository *repo)
153153
git_cache_clear(&repo->objects);
154154
git_attr_cache_flush(repo);
155155
git_grafts_free(repo->grafts);
156+
repo->grafts = NULL;
156157
git_grafts_free(repo->shallow_grafts);
158+
repo->shallow_grafts = NULL;
157159

158160
set_config(repo, NULL);
159161
set_index(repo, NULL);

src/libgit2/streams/stransport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static OSStatus write_cb(SSLConnectionRef conn, const void *data, size_t *len)
162162
if (ret < 0) {
163163
st->error = ret;
164164
return (ret == GIT_TIMEOUT) ?
165-
errSSLNetworkTimeout :
165+
-9853 /* errSSLNetworkTimeout */:
166166
-36 /* ioErr */;
167167
}
168168

@@ -214,7 +214,7 @@ static OSStatus read_cb(SSLConnectionRef conn, void *data, size_t *len)
214214
if (ret < 0) {
215215
st->error = ret;
216216
error = (ret == GIT_TIMEOUT) ?
217-
errSSLNetworkTimeout :
217+
-9853 /* errSSLNetworkTimeout */:
218218
-36 /* ioErr */;
219219
break;
220220
} else if (ret == 0) {

src/libgit2/transports/ssh.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,11 +877,12 @@ static int _git_ssh_setup_conn(
877877
t->current_stream = s;
878878

879879
done:
880+
if (known_hosts)
881+
libssh2_knownhost_free(known_hosts);
882+
880883
if (error < 0) {
881884
ssh_stream_free(*stream);
882885

883-
if (known_hosts)
884-
libssh2_knownhost_free(known_hosts);
885886
if (session)
886887
libssh2_session_free(session);
887888
}

0 commit comments

Comments
 (0)