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:
Jakub Jelen 2020-08-12 11:06:09 +02:00 committed by Jakub Jelen
parent dce4ad1aa2
commit d743a347d7
1 changed files with 1 additions and 0 deletions

View File

@ -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 */
free(priv->token_name);
priv->token_name = malloc(decompressed_header->token_name_length+1);
if (priv->token_name == NULL) {
r = SC_ERROR_OUT_OF_MEMORY;