diff options
author | /C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu> | 2008-10-25 12:50:34 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu> | 2008-10-25 12:50:34 +0000 |
commit | 894ebbc905ea760bab182513a74dc8bf3c2952cd (patch) | |
tree | ee73c1f0d37fc4dfcf2bee2f3afbe541218e3d01 /ipset.c | |
parent | 46fb717308d9d717439badd48c150e32a3508a90 (diff) |
2.4.3
- Include file <limits.h> was missing from userspace set type
modules.
Diffstat (limited to 'ipset.c')
-rw-r--r-- | ipset.c | 40 |
1 files changed, 21 insertions, 19 deletions
@@ -7,19 +7,22 @@ * published by the Free Software Foundation. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <time.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <arpa/inet.h> -#include <stdarg.h> -#include <netdb.h> -#include <dlfcn.h> -#include <fcntl.h> +#include <stdio.h> /* *printf, perror, sscanf, fdopen */ +#include <string.h> /* mem*, str* */ +#include <errno.h> /* errno, perror */ +#include <time.h> /* time, ctime */ +#include <netdb.h> /* gethostby*, getnetby*, getservby* */ +#include <stdlib.h> /* exit, malloc, free, strtol, getenv, mkstemp */ +#include <unistd.h> /* read, close, fork, exec*, unlink */ +#include <sys/types.h> /* open, wait, socket, *sockopt, umask */ +#include <sys/stat.h> /* open, umask */ +#include <sys/wait.h> /* wait */ +#include <sys/socket.h> /* socket, *sockopt, gethostby*, inet_* */ +#include <netinet/in.h> /* inet_* */ +#include <fcntl.h> /* open */ +#include <arpa/inet.h> /* htonl, inet_* */ +#include <stdarg.h> /* va_* */ +#include <dlfcn.h> /* dlopen */ #include "ipset.h" @@ -510,13 +513,12 @@ char *ipset_strdup(const char *s) return p; } -void ipset_free(void **data) +void ipset_free(void *data) { - if (*data == NULL) + if (data == NULL) return; - free(*data); - *data = NULL; + free(data); } static struct option *merge_options(struct option *oldopts, @@ -1265,7 +1267,7 @@ static int try_save_sets(const char name[IP_SET_MAXNAMELEN]) printf("COMMIT\n"); now = time(NULL); printf("# Completed on %s", ctime(&now)); - ipset_free(&data); + ipset_free(data); return res; } @@ -1847,7 +1849,7 @@ static int try_list_sets(const char name[IP_SET_MAXNAMELEN], while (size != req_size) size += print_set(data + size, options); - ipset_free(&data); + ipset_free(data); return res; } |