nfctype2: Fix possible NULL pointer dereference in nfctype2_format
authorSzymon Janc <szymon.janc@tieto.com>
Tue, 7 Aug 2012 12:22:29 +0000 (14:22 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 14 Aug 2012 15:14:40 +0000 (17:14 +0200)
commit68e0a143bcb104c87440471401ce1eb19e679211
tree36e38933ea30647d4f1b3e03e13e4bd98aa2d96b
parent3dfc77dfc12f2cf4cf8b2bff88b6dbed2b0b5c8d
nfctype2: Fix possible NULL pointer dereference in nfctype2_format

Check if memory allocation succeed before dereferencing pointers and
free any allocated memory before returning. This also fix memory leaks
if call to near_adapter_send failed.
plugins/nfctype2.c