From: Bartosz Golaszewski Date: Wed, 1 Mar 2017 10:19:12 +0000 (+0100) Subject: core: use the 'malloc' attribute X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0309da9ecba34e7e25b4afa0229544ba366b129f;p=qemu-gpiodev%2Flibgpiod.git core: use the 'malloc' attribute Use the 'malloc' gcc attribute in the zalloc() definition. Signed-off-by: Bartosz Golaszewski --- 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;