nfctool: Add a null pointer check in llcp_decode_cleanup
authorThierry Escande <thierry.escande@linux.intel.com>
Thu, 27 Jun 2013 10:04:00 +0000 (12:04 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 28 Jun 2013 08:06:42 +0000 (10:06 +0200)
g_hash_table_destroy raises an assert when called with a null pointer.
connection_hash can be NULL when sniffer_init() fails before calling
llcp_init().

tools/nfctool/llcp-decode.c

index 6f8c59d..8afa067 100644 (file)
@@ -612,7 +612,8 @@ void llcp_decode_cleanup(void)
 
        snep_decode_cleanup();
 
-       g_hash_table_destroy(connection_hash);
+       if (connection_hash)
+               g_hash_table_destroy(connection_hash);
 }
 
 int llcp_decode_init(void)