few missing free()

This commit is contained in:
Philippe Teuwen 2012-03-15 09:16:55 +00:00
parent e096f1f421
commit e9cf48081b
2 changed files with 4 additions and 0 deletions

View file

@ -179,6 +179,7 @@ main(int argc, char *argv[])
if (fread (ndef_msg, 1, ndef_msg_len, ndef_stream) != ndef_msg_len) { 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); fprintf (stderr, "Could not read NDEF from file: %s\n", ndef_input);
fclose (ndef_stream); fclose (ndef_stream);
free (ndef_msg);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
fclose (ndef_stream); fclose (ndef_stream);
@ -400,6 +401,8 @@ error:
free (tag_uid); free (tag_uid);
} }
if (ndef_msg != ndef_default_msg)
free (ndef_msg);
freefare_free_tags (tags); freefare_free_tags (tags);
nfc_close (device); nfc_close (device);
} }

View file

@ -256,6 +256,7 @@ main(int argc, char *argv[])
} }
free (tag_uid); free (tag_uid);
} }
free (ndef_msg);
freefare_free_tags (tags); freefare_free_tags (tags);
nfc_close (device); nfc_close (device);
} }