Commit 177118fc authored by Rich Salz's avatar Rich Salz
Browse files

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: default avatarDr. Stephen Henson <steve@openssl.org>
parent 551ed53b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -553,6 +553,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))
			{
@@ -579,7 +584,6 @@ 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);
	    }
	}