Fix memory leak 08/245508/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Oct 2020 00:35:30 +0000 (09:35 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Oct 2020 00:47:03 +0000 (09:47 +0900)
Change-Id: I307e20f2a5a98b93d1e12a2dc4489d656789810c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/app_control/resolve_info.cc

index 0e2f5c7d8578746e89a7f8c7756b079cdc166403..d71ab192012b446410698b46578b290d2e51568e 100644 (file)
@@ -164,10 +164,12 @@ int ResolveInfo::Manager::GetSchemeAndHost(const std::string& uri,
     match_info_ptr(match_info, g_match_info_free);
 
   gchar* scheme_ptr = g_match_info_fetch(match_info, 2);
+  auto scheme_p = std::unique_ptr<gchar, decltype(g_free)*>(scheme_ptr, g_free);
   if (scheme_ptr)
     scheme = scheme_ptr;
 
   gchar* host_ptr = g_match_info_fetch(match_info, 4);
+  auto host_p = std::unique_ptr<gchar, decltype(g_free)*>(host_ptr, g_free);
   if (host_ptr)
     host = host_ptr;