Skip to content

Commit 1dc7f70

Browse files
committed
Malloc cred->cred
1 parent dab537d commit 1dc7f70

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/libmongoc/src/mongoc/mongoc-stream-tls-secure-channel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,10 @@ mongoc_secure_channel_cred_new(const mongoc_ssl_opt_t *opt)
856856
mongoc_secure_channel_cred *cred = bson_malloc0(sizeof(mongoc_secure_channel_cred));
857857

858858
#ifdef MONGOC_HAVE_SCH_CREDENTIALS
859+
cred->cred = bson_malloc0(sizeof(SCH_CREDENTIALS));
859860
cred->cred->dwVersion = SCH_CREDENTIALS_VERSION;
860861
#else
862+
cred->cred = bson_malloc0(sizeof(SCHANNEL_CRED));
861863
cred->cred->dwVersion = SCHANNEL_CRED_VERSION;
862864
#endif
863865

@@ -936,6 +938,7 @@ mongoc_secure_channel_cred_deleter(void *cred_void)
936938
return;
937939
}
938940
CertFreeCertificateContext(cred->cert);
941+
bson_free(cred->cred);
939942
bson_free(cred);
940943
}
941944

src/libmongoc/src/mongoc/mongoc-version-functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MONGOC_EXPORT(bool)
3838
mongoc_check_version(int required_major, int required_minor, int required_micro);
3939
#ifdef _WIN32
4040
MONGOC_EXPORT(bool)
41-
_mongoc_verify_windows_version(int major_version, int minor_version, int build_number, bool strictly_equal);
41+
_mongoc_verify_windows_version(int major_version, int minor_version, int build_number, bool strictly_equal);
4242
#endif
4343

4444
BSON_END_DECLS

0 commit comments

Comments
 (0)