krb5 commit: define USE_HEAPALLOC in gssapi_alloc.h

Sam Hartman hartmans at MIT.EDU
Mon Jul 16 09:33:12 EDT 2012


https://github.com/krb5/krb5/commit/c8cd6bd75776de265e34bc2dae9b3fd234759126
commit c8cd6bd75776de265e34bc2dae9b3fd234759126
Author: Kevin Wasserman <kevin.wasserman at painless-security.com>
Date:   Wed Oct 26 07:24:23 2011 -0400

    define USE_HEAPALLOC in gssapi_alloc.h
    
    Easier to disable for testing.
    
    Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>
    
    ticket: 7211 (new)

 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 713c895..9c0f340 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);


More information about the cvs-krb5 mailing list