From: Nishant Chaprana Date: Wed, 8 Sep 2021 06:15:23 +0000 (+0530) Subject: Fix NULL pointer dereference X-Git-Tag: submit/tizen/20210915.152102^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_7.0;p=platform%2Fcore%2Fconnectivity%2Finm-manager.git Fix NULL pointer dereference The wrapper function is called in scenarios in which p_trace_route can be NULL. So NULL check should be performed before deallocation of memory. Change-Id: I3e985f6890b1f2233a16e08c9cf7e10217b2dd3b Signed-off-by: Nishant Chaprana --- diff --git a/src/inm-trace-route.c b/src/inm-trace-route.c index 1667a0c..d3c4214 100644 --- a/src/inm-trace-route.c +++ b/src/inm-trace-route.c @@ -541,6 +541,9 @@ static inline int __create_sock_data() static inline void __clear_trace_route_data(inm_trace_route_data_s *p_trace_route) { + if (!p_trace_route) + return; + REMOVE_G_SOURCE(p_trace_route->tr_timer_source_id); inm_util_destroy_gio_channel(p_trace_route->sock_io_channel, FALSE); g_free(p_trace_route->target);