Module: wine Branch: master Commit: 64d9d63fecb87c9dcfe14539c68bcf9b999c1072 URL: https://gitlab.winehq.org/wine/wine/-/commit/64d9d63fecb87c9dcfe14539c68bcf9...
Author: Alex Henrie alexhenrie24@gmail.com Date: Wed Aug 16 21:04:49 2023 -0600
adsldp: Use CRT allocation functions.
---
dlls/adsldp/adsldp_private.h | 4 +--- dlls/adsldp/schema.c | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/dlls/adsldp/adsldp_private.h b/dlls/adsldp/adsldp_private.h index 5d8b8177a7b..73bf8f379fd 100644 --- a/dlls/adsldp/adsldp_private.h +++ b/dlls/adsldp/adsldp_private.h @@ -19,8 +19,6 @@ #ifndef _ADSLDP_PRIVATE_H #define _ADSLDP_PRIVATE_H
-#include "wine/heap.h" - static inline LPWSTR strnUtoW( LPCSTR str, DWORD inlen, DWORD *outlen ) { LPWSTR ret = NULL; @@ -28,7 +26,7 @@ static inline LPWSTR strnUtoW( LPCSTR str, DWORD inlen, DWORD *outlen ) if (str) { DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, inlen, NULL, 0 ); - if ((ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) + if ((ret = malloc( (len + 1) * sizeof(WCHAR) ))) { MultiByteToWideChar( CP_UTF8, 0, str, inlen, ret, len ); ret[len] = 0; diff --git a/dlls/adsldp/schema.c b/dlls/adsldp/schema.c index 7a530cc57e3..d8d0d7e9cde 100644 --- a/dlls/adsldp/schema.c +++ b/dlls/adsldp/schema.c @@ -116,9 +116,9 @@ ADSTYPEENUM get_schema_type(const WCHAR *name, const struct attribute_type *at,
static void free_attribute_type(struct attribute_type *at) { - heap_free(at->oid); - heap_free(at->name); - heap_free(at->syntax); + free(at->oid); + free(at->name); + free(at->syntax); }
void free_attribute_types(struct attribute_type *at, ULONG count) @@ -128,7 +128,7 @@ void free_attribute_types(struct attribute_type *at, ULONG count) for (i = 0; i < count; i++) free_attribute_type(&at[i]);
- heap_free(at); + free(at); }
static BOOL is_space(WCHAR c) @@ -156,7 +156,7 @@ static WCHAR *parse_oid(WCHAR **str) }
count = end - p; - oid = heap_alloc((count + 1) * sizeof(WCHAR)); + oid = malloc((count + 1) * sizeof(WCHAR)); if (!oid) return NULL;
memcpy(oid, p, count * sizeof(WCHAR)); @@ -202,17 +202,14 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count)
count = wcslen(tmp_name);
- if (!name) - new_name = heap_alloc((count + 1) * sizeof(WCHAR)); - else - new_name = heap_realloc(name, (total_count + count + 1) * sizeof(WCHAR)); + new_name = realloc(name, (total_count + count + 1) * sizeof(WCHAR));
if (!new_name) break;
memcpy(new_name + total_count, tmp_name, (count + 1) * sizeof(WCHAR));
name = new_name; - heap_free(tmp_name); + free(tmp_name); total_count += count + 1;
*name_count += 1; @@ -221,7 +218,7 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count)
*str = *p ? p + 1 : p;
- heap_free(name); + free(name); return NULL; }
@@ -236,7 +233,7 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count) if (!end) return NULL;
count = end - p; - name = heap_alloc((count + 1) * sizeof(WCHAR)); + name = malloc((count + 1) * sizeof(WCHAR)); if (!name) return NULL;
memcpy(name, p, count * sizeof(WCHAR)); @@ -400,7 +397,7 @@ struct attribute_type *load_schema(LDAP *ld, ULONG *at_single_count, ULONG *at_m { ULONG i, total = ldap_count_valuesW(types);
- at = heap_alloc(total * sizeof(*at)); + at = malloc(total * sizeof(*at)); if (!at) goto exit;
for (i = 0; i < total; i++)