Fix a potential memory leak

If tlvblock is not stored then the value is lost and the allocated
mempry is leaked.

Coverity: Resource leak (RESOURCE_LEAK)
Calling allocation function "pgp_build_tlv" on "tlvblock".
This commit is contained in:
Ludovic Rousseau 2012-08-24 00:10:01 +02:00 committed by Viktor Tarasov
parent b90a557237
commit ed959004dd
1 changed files with 2 additions and 0 deletions

View File

@ -2057,6 +2057,8 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
if (result != NULL) {
*result = tlvblock;
*resultlen = tlvlen;
} else {
free(tlvblock);
}
out1: