diff options
author | Matt Kraai <kraai@debian.org> | 2001-07-19 15:00:14 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-07-19 15:00:14 +0000 |
commit | c1cda4a6091902bdb81cb8938838f4b26ddc52cf (patch) | |
tree | d372e32f465bdddb1a900a13303ed9ead4d0320f /include/busybox.h | |
parent | 81108e7653583508bfc541748845183c56e0e378 (diff) | |
download | busybox-w32-c1cda4a6091902bdb81cb8938838f4b26ddc52cf.tar.gz busybox-w32-c1cda4a6091902bdb81cb8938838f4b26ddc52cf.tar.bz2 busybox-w32-c1cda4a6091902bdb81cb8938838f4b26ddc52cf.zip |
Add a RELEASE_BB_BUFFER macro and use it to fix a memory leak in syslogd.c
(noted by Adam Slattery).
Diffstat (limited to 'include/busybox.h')
-rw-r--r-- | include/busybox.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/busybox.h b/include/busybox.h index e8055b06c..f79dac8c8 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -69,13 +69,16 @@ extern const struct BB_applet applets[]; | |||
69 | #ifdef BB_FEATURE_BUFFERS_GO_ON_STACK | 69 | #ifdef BB_FEATURE_BUFFERS_GO_ON_STACK |
70 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] | 70 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] |
71 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] | 71 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] |
72 | #define RELEASE_BB_BUFFER(buffer) ((void)0) | ||
72 | #else | 73 | #else |
73 | #ifdef BB_FEATURE_BUFFERS_GO_IN_BSS | 74 | #ifdef BB_FEATURE_BUFFERS_GO_IN_BSS |
74 | #define RESERVE_BB_BUFFER(buffer,len) static char buffer[len] | 75 | #define RESERVE_BB_BUFFER(buffer,len) static char buffer[len] |
75 | #define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len] | 76 | #define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len] |
77 | #define RELEASE_BB_BUFFER(buffer) ((void)0) | ||
76 | #else | 78 | #else |
77 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) | 79 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) |
78 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) | 80 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) |
81 | #define RELEASE_BB_BUFFER(buffer) free (buffer) | ||
79 | #endif | 82 | #endif |
80 | #endif | 83 | #endif |
81 | 84 | ||