From 0309da9ecba34e7e25b4afa0229544ba366b129f Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 1 Mar 2017 11:19:12 +0100 Subject: [PATCH] core: use the 'malloc' attribute Use the 'malloc' gcc attribute in the zalloc() definition. Signed-off-by: Bartosz Golaszewski --- src/lib/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/core.c b/src/lib/core.c index c5e8152..2d313bc 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -23,6 +23,8 @@ #include #include +#define MALLOC __attribute__((malloc)) + struct gpiod_chip { int fd; struct gpiochip_info cinfo; @@ -95,7 +97,7 @@ static void last_error_from_errno(void) last_error = errno; } -static void * zalloc(size_t size) +static MALLOC void * zalloc(size_t size) { void *ptr; -- 2.30.2