projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58f0f52
)
Handle BN_copy failure after successful BN_new.
author
Bodo Möller
<bodo@openssl.org>
Tue, 7 Nov 2000 09:39:51 +0000
(09:39 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Tue, 7 Nov 2000 09:39:51 +0000
(09:39 +0000)
crypto/bn/bn_lib.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_lib.c
b/crypto/bn/bn_lib.c
index 89a3267b4af10485ef95b9ffe5e33a169e352feb..0ad62652f6960798eef116aa95f787041d93bd9d 100644
(file)
--- a/
crypto/bn/bn_lib.c
+++ b/
crypto/bn/bn_lib.c
@@
-507,15
+507,19
@@
BIGNUM *bn_expand2(BIGNUM *b, int words)
BIGNUM *BN_dup(const BIGNUM *a)
{
- BIGNUM *r;
+ BIGNUM *r
, *t
;
if (a == NULL) return NULL;
bn_check_top(a);
- r=BN_new();
- if (r == NULL) return(NULL);
- return((BIGNUM *)BN_copy(r,a));
+ t = BN_new();
+ if (t == NULL) return(NULL);
+ r = BN_copy(t, a);
+ /* now r == t || r == NULL */
+ if (r == NULL)
+ BN_free(t);
+ return r;
}
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)