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;
|
||||
|
||||
bignum = malloc(sizeof(_libssh2_bn));
|
||||
bignum->bignum = NULL;
|
||||
bignum->length = 0;
|
||||
bignum = (_libssh2_bn *)malloc(sizeof(_libssh2_bn));
|
||||
if (bignum) {
|
||||
bignum->bignum = NULL;
|
||||
bignum->length = 0;
|
||||
}
|
||||
|
||||
return bignum;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user