Thanks for the report. The MSDN documentation for HeapReAlloc() does say that the input pointer "is returned by an earlier call to the HeapAlloc or HeapReAlloc function" so I guess it is within its rights to fail on a NULL input, unlike C's realloc(). Do you have a patch that you have tested for this issue? My initial inclination is to change the Windows definition of gssalloc_realloc() (in gssapi_alloc.h) to: static inline void * gssalloc_realloc(void *value, size_t size) { /* Unlike realloc(), HeapReAlloc() does not work on NULL. */ if (value == NULL) return HeapAlloc(GetProcessHeap(), 0, size); return HeapReAlloc(GetProcessHeap(), 0, value, size); }