pkcs15-authentic.c: fixed potential resource leak
This commit is contained in:
parent
f9a73c0b20
commit
7e29fcd26c
|
@ -350,8 +350,10 @@ authentic_sdo_allocate_prvkey(struct sc_profile *profile, struct sc_card *card,
|
|||
LOG_TEST_RET(ctx, rv, "Cannot instantiate new PRKEY-RSA file");
|
||||
|
||||
sdo = calloc(1, sizeof(struct sc_authentic_sdo));
|
||||
if (!sdo)
|
||||
if (!sdo) {
|
||||
sc_file_free(file);
|
||||
LOG_TEST_RET(ctx, SC_ERROR_OUT_OF_MEMORY, "Cannot allocate 'sc_authentic_sdo'");
|
||||
}
|
||||
*out = sdo;
|
||||
|
||||
sdo->magic = AUTHENTIC_SDO_MAGIC;
|
||||
|
|
Loading…
Reference in New Issue