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>
p += seq_len;
}
- if (ret && ret != MBEDTLS_ERR_ASN1_OUT_OF_DATA)
- return ret;
-
msg->have_authattrs = true;
/*
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,
static char *x509_populate_dn_name_string(const mbedtls_x509_name *name)
{
size_t len = 256;
- size_t wb;
+ int wb;
char *name_str;
do {