diff options
author | Kevin Wasserman <kevin.wasserman@painless-security.com> | 2011-10-26 07:24:23 -0400 |
---|---|---|
committer | Sam Hartman <hartmans@mit.edu> | 2012-07-16 09:31:15 -0400 |
commit | c8cd6bd75776de265e34bc2dae9b3fd234759126 (patch) | |
tree | 7aa21d3b4d89cfd7816e0e3104725fa0d3619123 /src/lib/gssapi | |
parent | 7d156d88ce5cdc40b1df02f051d65b3ad93c60e1 (diff) | |
download | krb5-c8cd6bd75776de265e34bc2dae9b3fd234759126.tar.gz krb5-c8cd6bd75776de265e34bc2dae9b3fd234759126.tar.xz krb5-c8cd6bd75776de265e34bc2dae9b3fd234759126.zip |
define USE_HEAPALLOC in gssapi_alloc.h
Easier to disable for testing.
Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7211 (new)
Diffstat (limited to 'src/lib/gssapi')
-rw-r--r-- | src/lib/gssapi/generic/gssapi_alloc.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/gssapi/generic/gssapi_alloc.h b/src/lib/gssapi/generic/gssapi_alloc.h index 713c89537..9c0f340b1 100644 --- a/src/lib/gssapi/generic/gssapi_alloc.h +++ b/src/lib/gssapi/generic/gssapi_alloc.h @@ -9,6 +9,9 @@ #ifdef _WIN32 #include "winbase.h" +#define USE_HEAPALLOC 1 +#else +#define USE_HEAPALLOC 0 #endif #include <string.h> @@ -16,7 +19,7 @@ static inline void gssalloc_free(void * value) { if (value) { -#if _WIN32 +#if USE_HEAPALLOC HeapFree(GetProcessHeap(), 0, value); #else free(value); @@ -27,7 +30,7 @@ gssalloc_free(void * value) static inline void * gssalloc_malloc(size_t size) { -#if _WIN32 +#if USE_HEAPALLOC return HeapAlloc(GetProcessHeap(), 0, size); #else return malloc(size); @@ -37,7 +40,7 @@ gssalloc_malloc(size_t size) static inline void * gssalloc_calloc(size_t count, size_t size) { -#if _WIN32 +#if USE_HEAPALLOC return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size); #else return calloc(count, size); @@ -47,7 +50,7 @@ gssalloc_calloc(size_t count, size_t size) static inline void * gssalloc_realloc(void *value, size_t size) { -#if _WIN32 +#if USE_HEAPALLOC return HeapReAlloc(GetProcessHeap(), 0, value, size); #else return realloc(value, size); |