fixed potentially dereferencing null pointer

This commit is contained in:
Frank Morgner
2015-01-25 03:53:52 +01:00
parent f03760e27e
commit feebfe7a74
4 changed files with 14 additions and 7 deletions

View File

@@ -1739,7 +1739,10 @@ err:
BUF_MEM_clear_free(nonce);
BUF_MEM_clear_free(signature);
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
if (card)
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
else
return r;
}
static int npa_mse_set_at_ca(sc_card_t *card, int protocol)
@@ -1931,7 +1934,10 @@ err:
BUF_MEM_clear_free(token);
BUF_MEM_clear_free(eph_pub_key);
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
if (card)
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, r);
else
return r;
}
static const char *MRZ_name = "MRZ";