Hans Leidekker : kerberos: Use the global memory allocation helpers.

Alexandre Julliard julliard at winehq.org
Fri Feb 2 12:24:38 CST 2018


Module: wine
Branch: master
Commit: 51a0b4ebb110645a9bd578c04dd574f87f56ccc2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=51a0b4ebb110645a9bd578c04dd574f87f56ccc2

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Feb  2 12:20:25 2018 +0100

kerberos: Use the global memory allocation helpers.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kerberos/krb5_ap.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c
index d2280e5..8b5b612 100644
--- a/dlls/kerberos/krb5_ap.c
+++ b/dlls/kerberos/krb5_ap.c
@@ -43,6 +43,7 @@
 #include "ntsecapi.h"
 #include "ntsecpkg.h"
 #include "winternl.h"
+#include "wine/heap.h"
 #include "wine/library.h"
 #include "wine/debug.h"
 
@@ -106,21 +107,6 @@ MAKE_FUNCPTR(krb5_free_unparsed_name);
 MAKE_FUNCPTR(krb5_free_cred_contents);
 #undef MAKE_FUNCPTR
 
-static inline void *heap_alloc(SIZE_T size)
-{
-    return HeapAlloc(GetProcessHeap(), 0, size);
-}
-
-static inline void *heap_realloc(void *p, SIZE_T size)
-{
-    return HeapReAlloc(GetProcessHeap(), 0, p, size);
-}
-
-static inline void heap_free(void *p)
-{
-    HeapFree(GetProcessHeap(), 0, p);
-}
-
 static void load_krb5(void)
 {
     if (!(libkrb5_handle = wine_dlopen(SONAME_LIBKRB5, RTLD_NOW, NULL, 0)))
@@ -757,7 +743,7 @@ static SECURITY_STATUS name_sspi_to_gss( const UNICODE_STRING *name_str, gss_nam
     gss_buffer_desc buf;
 
     buf.length = WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), NULL, 0, NULL, NULL ) + 1;
-    if (!(buf.value = HeapAlloc( GetProcessHeap(), 0, buf.length ))) return SEC_E_INSUFFICIENT_MEMORY;
+    if (!(buf.value = heap_alloc( buf.length ))) return SEC_E_INSUFFICIENT_MEMORY;
     WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), buf.value, buf.length, NULL, NULL );
     buf.length--;
 
@@ -765,7 +751,7 @@ static SECURITY_STATUS name_sspi_to_gss( const UNICODE_STRING *name_str, gss_nam
     TRACE( "gss_import_name returned %08x minor status %08x\n", ret, minor_status );
     if (GSS_ERROR(ret)) trace_gss_status( ret, minor_status );
 
-    HeapFree( GetProcessHeap(), 0, buf.value );
+    heap_free( buf.value );
     return status_gss_to_sspi( ret );
 }
 




More information about the wine-cvs mailing list