diff options
author | /C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org </C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org> | 2007-07-24 05:45:33 +0000 |
---|---|---|
committer | /C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org </C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org> | 2007-07-24 05:45:33 +0000 |
commit | 4c1875afc6d017e83a5530dbce17c41c687e302b (patch) | |
tree | 52317cc3cc5562b3784b1a18e3d3e06ea09c1708 /xtables.c | |
parent | 9f9ec0183cbf7e8b1ed8a76000b6e8c654d7e28e (diff) |
Moves common fw_malloc() and fw_calloc() to xtables.c
Diffstat (limited to 'xtables.c')
-rw-r--r-- | xtables.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -16,4 +16,34 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> + +#include <iptables_common.h> #include <xtables.h> + +void *fw_calloc(size_t count, size_t size) +{ + void *p; + + if ((p = calloc(count, size)) == NULL) { + perror("ip[6]tables: calloc failed"); + exit(1); + } + + return p; +} + +void *fw_malloc(size_t size) +{ + void *p; + + if ((p = malloc(size)) == NULL) { + perror("ip[6]tables: malloc failed"); + exit(1); + } + + return p; +} |