]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
fix endless loop in redefined malloc/remalloc functions on system using uClibc
authorlzhou <lzhou@sonicwall.com>
Tue, 15 Oct 2024 02:48:13 +0000 (10:48 +0800)
committerVincent Bernat <vincent@bernat.ch>
Thu, 17 Oct 2024 06:09:01 +0000 (08:09 +0200)
src/compat/malloc.c
src/compat/realloc.c

index 0c8bb2c81a27067e0a0ed31d43876040a1bf8231..b881e080cbc85f10f17a00c421eb2993fe852e9d 100644 (file)
@@ -1,10 +1,10 @@
 /* -*- mode: c; c-file-style: "openbsd" -*- */
 /* malloc replacement that can allocate 0 byte */
 
-#undef malloc
 #include <stdlib.h>
 #include <sys/types.h>
 #include "compat.h"
+#undef malloc
 
 /* Allocate an N-byte block of memory from the heap.
    If N is zero, allocate a 1-byte block.  */
index 4d74064be3f78d87c59e1ba63a57db2a28182eac..1fe4743ab3b8e5997ea12f203110edddc93ec33a 100644 (file)
@@ -1,10 +1,10 @@
 /* -*- mode: c; c-file-style: "openbsd" -*- */
 /* realloc replacement that can reallocate 0 byte or NULL pointers*/
 
-#undef realloc
 #include <stdlib.h>
 #include <sys/types.h>
 #include "compat.h"
+#undef realloc
 
 /* Reallocate an N-byte block of memory from the heap.
    If N is zero, allocate a 1-byte block.  */