diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h index 7686d49f81..e0b8368273 100644 --- a/xen/include/xen/xvmalloc.h +++ b/xen/include/xen/xvmalloc.h @@ -61,8 +61,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align); /* Free an allocation, and zero the pointer to it. */ #define XVFREE(p) do { \ - xvfree(p); \ + void *_ptr_ = (p); \ (p) = NULL; \ + xvfree(_ptr_); \ } while ( false ) static inline void *_xvmalloc_array(