From 3e363eace81f17c2edb5a1dc5d3274b22e848f7f Mon Sep 17 00:00:00 2001 From: Seonah Moon <31679495+SeonahMoon@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:06:13 +0900 Subject: [PATCH] [Nsd] Fix ASAN crash (#5694) --- src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs | 6 ++++++ src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs b/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs index 87697b2..5e6bebb 100755 --- a/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs +++ b/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs @@ -119,4 +119,10 @@ internal static partial class Interop [DllImport(Libraries.Libc, EntryPoint = "free")] public static extern void Free(IntPtr userData); } + + internal static partial class Glib + { + [DllImport(Libraries.Glib, EntryPoint = "g_free", CallingConvention = CallingConvention.Cdecl)] + public static extern void Free(IntPtr userData); + } } diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs index 494a726..19049b3 100755 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs +++ b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs @@ -241,7 +241,7 @@ namespace Tizen.Network.Nsd { value = new byte[length]; Marshal.Copy(data, value, 0, length); - Interop.Libc.Free(data); + Interop.Glib.Free(data); } return value; } -- 2.7.4