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:
parent
06ff22f1a6
commit
bc9d735664
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user