PR: 1785
Submitted by: Ger Hobbelt <ger@hobbelt.com> Approved by: steve@openssl.org Properly handle malloc failure.
This commit is contained in:
parent
3877b6bfe9
commit
55ed10db21
@ -69,12 +69,15 @@ static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
if(operation == ASN1_OP_NEW_PRE) {
|
||||
DSA_SIG *sig;
|
||||
sig = OPENSSL_malloc(sizeof(DSA_SIG));
|
||||
if (!sig)
|
||||
{
|
||||
DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
sig->r = NULL;
|
||||
sig->s = NULL;
|
||||
*pval = (ASN1_VALUE *)sig;
|
||||
if(sig) return 2;
|
||||
DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user