coolkey: Avoid memory leak when processing multiple combined objects
Thanks oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24023
This commit is contained in:
parent
dce4ad1aa2
commit
d743a347d7
|
@ -2061,6 +2061,7 @@ coolkey_process_combined_object(sc_card_t *card, coolkey_private_data_t *priv, u
|
||||||
}
|
}
|
||||||
|
|
||||||
/* store the token name in the priv structure so the emulator can set it */
|
/* store the token name in the priv structure so the emulator can set it */
|
||||||
|
free(priv->token_name);
|
||||||
priv->token_name = malloc(decompressed_header->token_name_length+1);
|
priv->token_name = malloc(decompressed_header->token_name_length+1);
|
||||||
if (priv->token_name == NULL) {
|
if (priv->token_name == NULL) {
|
||||||
r = SC_ERROR_OUT_OF_MEMORY;
|
r = SC_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
Loading…
Reference in New Issue