From e9cf48081bd3bc06290d9970e849c7fa59c83cb6 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 15 Mar 2012 09:16:55 +0000 Subject: [PATCH] few missing free() --- examples/mifare-classic-write-ndef.c | 3 +++ examples/mifare-desfire-write-ndef.c | 1 + 2 files changed, 4 insertions(+) diff --git a/examples/mifare-classic-write-ndef.c b/examples/mifare-classic-write-ndef.c index b6f7436..8a37a9d 100644 --- a/examples/mifare-classic-write-ndef.c +++ b/examples/mifare-classic-write-ndef.c @@ -179,6 +179,7 @@ main(int argc, char *argv[]) if (fread (ndef_msg, 1, ndef_msg_len, ndef_stream) != ndef_msg_len) { fprintf (stderr, "Could not read NDEF from file: %s\n", ndef_input); fclose (ndef_stream); + free (ndef_msg); exit (EXIT_FAILURE); } fclose (ndef_stream); @@ -400,6 +401,8 @@ error: free (tag_uid); } + if (ndef_msg != ndef_default_msg) + free (ndef_msg); freefare_free_tags (tags); nfc_close (device); } diff --git a/examples/mifare-desfire-write-ndef.c b/examples/mifare-desfire-write-ndef.c index d98b4f9..d20465c 100644 --- a/examples/mifare-desfire-write-ndef.c +++ b/examples/mifare-desfire-write-ndef.c @@ -256,6 +256,7 @@ main(int argc, char *argv[]) } free (tag_uid); } + free (ndef_msg); freefare_free_tags (tags); nfc_close (device); }