projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1941cb1
)
core: use the 'malloc' attribute
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Wed, 1 Mar 2017 10:19:12 +0000
(11:19 +0100)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Wed, 1 Mar 2017 10:19:12 +0000
(11:19 +0100)
Use the 'malloc' gcc attribute in the zalloc() definition.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/core.c
patch
|
blob
|
history
diff --git
a/src/lib/core.c
b/src/lib/core.c
index c5e815293231da1f5f166951b51dc1fb407ca517..2d313bc167480956f3e962a4a11e0ce299904586 100644
(file)
--- a/
src/lib/core.c
+++ b/
src/lib/core.c
@@
-23,6
+23,8
@@
#include <poll.h>
#include <linux/gpio.h>
+#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;