nfctype1: Fix possible memory leak in meta_recv
authorWiktor Lawski <wiktor.lawski@tieto.com>
Wed, 19 Sep 2012 13:20:42 +0000 (15:20 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 21 Sep 2012 07:20:38 +0000 (09:20 +0200)
If read_dynamic_tag returned an error or neard does not support specified
response, memory allocated for t1_tag should also be freed.

plugins/nfctype1.c

index b1c1027..7fb4e0c 100644 (file)
@@ -336,6 +336,9 @@ static int meta_recv(uint8_t *resp, int length, void *data)
                err = -EOPNOTSUPP;
        }
 
+       if (err < 0)
+               g_free(t1_tag);
+
 out_err:
        DBG("err %d", err);