diff options
author | Matt Kraai | 2001-07-19 15:00:14 +0000 |
---|---|---|
committer | Matt Kraai | 2001-07-19 15:00:14 +0000 |
commit | c1cda4a6091902bdb81cb8938838f4b26ddc52cf (patch) | |
tree | d372e32f465bdddb1a900a13303ed9ead4d0320f /busybox.h | |
parent | 81108e7653583508bfc541748845183c56e0e378 (diff) | |
download | busybox-c1cda4a6091902bdb81cb8938838f4b26ddc52cf.zip busybox-c1cda4a6091902bdb81cb8938838f4b26ddc52cf.tar.gz |
Add a RELEASE_BB_BUFFER macro and use it to fix a memory leak in syslogd.c
(noted by Adam Slattery).
Diffstat (limited to 'busybox.h')
-rw-r--r-- | busybox.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -69,13 +69,16 @@ extern const struct BB_applet applets[]; #ifdef BB_FEATURE_BUFFERS_GO_ON_STACK #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] +#define RELEASE_BB_BUFFER(buffer) ((void)0) #else #ifdef BB_FEATURE_BUFFERS_GO_IN_BSS #define RESERVE_BB_BUFFER(buffer,len) static char buffer[len] #define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len] +#define RELEASE_BB_BUFFER(buffer) ((void)0) #else #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) +#define RELEASE_BB_BUFFER(buffer) free (buffer) #endif #endif |