Skip to content

Commit

Permalink
[Nsd] Fix ASAN crash (Samsung#5632)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonahMoon authored and Eunki, Hong committed Oct 25, 2023
1 parent 2311262 commit 71276ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ internal static partial class Libc
[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);
}
}
2 changes: 1 addition & 1 deletion src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public byte[] GetRawTXTRecords()
{
value = new byte[length];
Marshal.Copy(data, value, 0, length);
Interop.Libc.Free(data);
Interop.Glib.Free(data);
}
return value;
}
Expand Down

0 comments on commit 71276ca

Please sign in to comment.