Fixed CID 1038526. 37/211937/1
authorprasadam-p <prasadam.p@samsung.com>
Mon, 12 Aug 2019 07:27:01 +0000 (12:57 +0530)
committerprashanth prasadam <prasadam.p@samsung.com>
Mon, 12 Aug 2019 07:39:07 +0000 (13:09 +0530)
Moved the log before the pcap_close call to fix USE_AFTER_FREE error.

Change-Id: Ie586c93e538c0297cc3dfa5a18719fa21db137f3
Signed-off-by: prashanth prasadam <prasadam.p@samsung.com>
plugin/pcap/stc-plugin-pcap.c

index 0859700..862a0be 100755 (executable)
@@ -1441,8 +1441,8 @@ static gpointer __pcap_thread_func(gpointer data)
        pcap_loop(pcap_data->handle, 0, __pcap_handler, (u_char *)pcap_data);
        STC_LOGD("Pcap loop end [%s]", name);
 
+       STC_LOGD("Pcap before closing [%p]", pcap_data->handle);
        pcap_close(pcap_data->handle);
-       STC_LOGD("Pcap closed [%p]", pcap_data->handle);
 
 thread_exit:
        FREE(name);