ntdll: Fix valgrind heap realloc notifications.

Valgrind can't handle a realloc if the new size is zero.

Signed-off-by: Thomas Faller <tfaller1@gmx.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Thomas Faller 2015-12-16 22:00:58 +01:00 committed by Alexandre Julliard
parent 86df15cbf1
commit a0b8f178df

View file

@ -266,7 +266,8 @@ static inline void notify_free( void const *ptr )
static inline void notify_realloc( void const *ptr, SIZE_T size_old, SIZE_T size_new )
{
#ifdef VALGRIND_RESIZEINPLACE_BLOCK
VALGRIND_RESIZEINPLACE_BLOCK( ptr, size_old, size_new, 0 );
/* zero is not a valid size */
VALGRIND_RESIZEINPLACE_BLOCK( ptr, size_old ? size_old : 1, size_new ? size_new : 1, 0 );
#endif
}