mirror of
https://github.com/openssl/openssl.git
synced 2024-12-22 00:13:57 +08:00
RT2849: Redundant check of "dsa" variable.
In the current code, the check isn't redundant. And in fact the REAL check was missing. This avoids a NULL-deref crash. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
This commit is contained in:
parent
683cd7c948
commit
3173622ef6
@ -552,6 +552,11 @@ static void keypair(FILE *in, FILE *out)
|
||||
int n=atoi(value);
|
||||
|
||||
dsa = FIPS_dsa_new();
|
||||
if (!dsa)
|
||||
{
|
||||
fprintf(stderr, "DSA allocation error\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!dsa2 && !dsa_builtin_paramgen(dsa, L, N, NULL, NULL, 0,
|
||||
NULL, NULL, NULL, NULL))
|
||||
{
|
||||
@ -578,8 +583,7 @@ static void keypair(FILE *in, FILE *out)
|
||||
do_bn_print_name(out, "Y",dsa->pub_key);
|
||||
fputs(RESP_EOL, out);
|
||||
}
|
||||
if (dsa)
|
||||
FIPS_dsa_free(dsa);
|
||||
FIPS_dsa_free(dsa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user