diff options
-rw-r--r-- | src/wayland-private.h | 3 | ||||
-rw-r--r-- | src/wayland-util.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland-private.h b/src/wayland-private.h index ac712d9..ef58ccf 100644 --- a/src/wayland-private.h +++ b/src/wayland-private.h @@ -36,6 +36,9 @@ #include "wayland-util.h" +/* Invalid memory address */ +#define WL_ARRAY_POISON_PTR (void *) 4 + #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) #define container_of(ptr, type, member) ({ \ diff --git a/src/wayland-util.c b/src/wayland-util.c index 639ccf8..077fec7 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -102,6 +102,7 @@ WL_EXPORT void wl_array_release(struct wl_array *array) { free(array->data); + array->data = WL_ARRAY_POISON_PTR; } WL_EXPORT void * |