mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
mbedtls: fix defects in coverity scan
Fixes of unreleased buffer, deadcode and wrong variable type detected by coverity scan. Addresses-Coverity-ID: 510809: Resource leaks (RESOURCE_LEAK) Addresses-Coverity-ID: 510806: Control flow issues (DEADCODE) Addresses-Coverity-ID: 510794 Control flow issues (NO_EFFECT) Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
This commit is contained in:
parent
b92a18e2b6
commit
7f45377152
2 changed files with 4 additions and 5 deletions
|
@ -206,9 +206,6 @@ static int authattrs_parse(struct pkcs7_message *msg, void *aa, size_t aa_len,
|
|||
p += seq_len;
|
||||
}
|
||||
|
||||
if (ret && ret != MBEDTLS_ERR_ASN1_OUT_OF_DATA)
|
||||
return ret;
|
||||
|
||||
msg->have_authattrs = true;
|
||||
|
||||
/*
|
||||
|
@ -361,8 +358,10 @@ static int x509_populate_sinfo(struct pkcs7_message *msg,
|
|||
signed_info->sig = s;
|
||||
|
||||
/* Save the Authenticate Attributes data if exists */
|
||||
if (!mb_sinfo->authattrs.data || !mb_sinfo->authattrs.data_len)
|
||||
if (!mb_sinfo->authattrs.data || !mb_sinfo->authattrs.data_len) {
|
||||
kfree(mctx);
|
||||
goto no_authattrs;
|
||||
}
|
||||
|
||||
mctx->authattrs_data = kmemdup(mb_sinfo->authattrs.data,
|
||||
mb_sinfo->authattrs.data_len,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue