]> git.ipfire.org Git - thirdparty/lldpd.git/blob - src/compat/malloc.c
Separate daemon and client code. Provide a client library.
[thirdparty/lldpd.git] / src / compat / malloc.c
1 /* -*- mode: c; c-file-style: "openbsd" -*- */
2 /* malloc replacement that can allocate 0 byte */
3
4 #undef malloc
5 #include <stdlib.h>
6 #include <sys/types.h>
7
8 /* Allocate an N-byte block of memory from the heap.
9 If N is zero, allocate a 1-byte block. */
10 void *
11 rpl_malloc(size_t n)
12 {
13 if (n == 0) n = 1;
14 return malloc (n);
15 }