Skip to content

Commit

Permalink
Fix mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed May 18, 2017
1 parent 00700bc commit 14f48d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/nfc/nfc-types.h
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion libnfc/chips/pn53x.c
Expand Up @@ -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;
Expand Down

0 comments on commit 14f48d0

Please sign in to comment.