Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ internal static partial class Interop
[DllImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree", CharSet = CharSet.Ansi)]
public static extern void ldap_memfree([In] IntPtr value);

[DllImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree", CharSet = CharSet.Ansi)]
public static extern void ldap_msgfree([In] IntPtr value);

[DllImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext", CharSet = CharSet.Ansi)]
public static extern int ldap_modify([In] ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ internal static int GetLastErrorFromConnection(ConnectionHandle ldapHandle)

internal static void FreeMemory(IntPtr outValue) => Interop.ldap_memfree(outValue);

internal static void FreeMessage(IntPtr outValue) => Interop.ldap_msgfree(outValue);

internal static int ModifyDirectoryEntry(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber) =>
Interop.ldap_modify(ldapHandle, dn, attrs, servercontrol, clientcontrol, ref messageNumber);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ internal static int ExtendedDirectoryOperation(ConnectionHandle ldapHandle, stri

internal static void FreeMemory(IntPtr outValue) => Interop.ldap_memfree(outValue);

internal static void FreeMessage(IntPtr outValue) => Interop.ldap_msgfree(outValue);

internal static int ModifyDirectoryEntry(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber) =>
Interop.ldap_modify(ldapHandle, dn, attrs, servercontrol, clientcontrol, ref messageNumber);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ internal async ValueTask<DirectoryResponse> ConstructResponseAsync(int messageId

if (ldapResult != IntPtr.Zero)
{
LdapPal.FreeMemory(ldapResult);
LdapPal.FreeMessage(ldapResult);
}
}
}
Expand Down