mirror of
https://github.com/nfc-tools/libnfc.git
synced 2025-12-23 18:50:05 +00:00
Fix mem leak
This commit is contained in:
parent
00700bc66d
commit
14f48d0122
@ -311,7 +311,7 @@ typedef enum {
|
||||
NMT_ISO14443B2SR, // ISO14443-2B ST SRx
|
||||
NMT_ISO14443B2CT, // ISO14443-2B ASK CTx
|
||||
NMT_FELICA,
|
||||
NMT_DEP,
|
||||
NMT_DEP, // DEP should be kept last one as it's used as end-of-enum
|
||||
} nfc_modulation_type;
|
||||
|
||||
/**
|
||||
|
||||
@ -85,7 +85,7 @@ pn53x_init(struct nfc_device *pnd)
|
||||
}
|
||||
|
||||
if (!CHIP_DATA(pnd)->supported_modulation_as_initiator) {
|
||||
CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation_type) * 9);
|
||||
CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation_type) * (NMT_DEP + 1));
|
||||
if (! CHIP_DATA(pnd)->supported_modulation_as_initiator)
|
||||
return NFC_ESOFT;
|
||||
int nbSupportedModulation = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user