From b3066218aa8de35a47303bb198e62af43ca4d720 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 9 Nov 2012 15:28:06 -0500 Subject: [PATCH] Fix: Add pointer check when freeing poll events Signed-off-by: David Goulet --- src/common/compat/poll.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index 99b608cce..cfde4fc83 100644 --- a/src/common/compat/poll.h +++ b/src/common/compat/poll.h @@ -42,7 +42,9 @@ extern unsigned int poll_max_size; */ static inline void __lttng_poll_free(void *events) { - free(events); + if (events) { + free(events); + } } /* -- 2.34.1