diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h index 110b10e88c..83c9d4dea2 100644 --- a/xen/include/xen/xvmalloc.h +++ b/xen/include/xen/xvmalloc.h @@ -71,8 +71,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(