Commit 58f0f52e authored by Bodo Möller's avatar Bodo Möller
Browse files

handle the case when BN_new returns NULL

parent 55b3c877
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -458,12 +458,20 @@ BIGNUM *bn_dup_expand(const BIGNUM *b, int words)
		if (a)
			{
			r = BN_new();
			if (r)
				{
				r->top = b->top;
				r->dmax = words;
				r->neg = b->neg;
				r->d = a;
				}
		/* Otherwise, there was an error in allocation in
			else
				{
				/* r == NULL, BN_new failure */
				OPENSSL_free(a);
				}
			}
		/* If a == NULL, there was an error in allocation in
		   internal_bn_expand(), and NULL should be returned */
		}
	else