wincng.c: fix possible NULL pointer de-reference of bignum

Fixes VS2012 code analysis warning C6011:
dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567
This commit is contained in:
Marc Hoersken 2014-12-15 00:27:29 +01:00
parent 06ff22f1a6
commit bc9d735664

View File

@ -1563,9 +1563,11 @@ _libssh2_wincng_bignum_init(void)
{ {
_libssh2_bn *bignum; _libssh2_bn *bignum;
bignum = malloc(sizeof(_libssh2_bn)); bignum = (_libssh2_bn *)malloc(sizeof(_libssh2_bn));
bignum->bignum = NULL; if (bignum) {
bignum->length = 0; bignum->bignum = NULL;
bignum->length = 0;
}
return bignum; return bignum;
} }