diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-14 20:09:06 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-14 20:09:06 +0100 |
commit | e351346da584402647a147514610a744ee064d8e (patch) | |
tree | c1f1889255bb315c8d94b665a2125d36248342b1 /src/hash.c | |
parent | 3c3256c5c0ca81486df3aaddf95e76d73849ba7f (diff) | |
download | conntrack-tools-e351346da584402647a147514610a744ee064d8e.tar.gz conntrack-tools-e351346da584402647a147514610a744ee064d8e.zip |
hashtable: check NULL instead of ! for pointers
This patch is a cleanup. Check NULL instead of using ! for null
pointers.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/hash.c')
-rw-r--r-- | src/hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -31,7 +31,7 @@ struct hashtable_node *hashtable_alloc_node(int datasize, void *data) int size = sizeof(struct hashtable_node) + datasize; n = calloc(size, 1); - if (!n) + if (n == NULL) return NULL; memcpy(n->data, data, datasize); @@ -55,7 +55,7 @@ hashtable_create(int hashsize, int limit, int datasize, + hashsize * sizeof(struct slist_head); h = (struct hashtable *) calloc(size, 1); - if (!h) { + if (h == NULL) { errno = ENOMEM; return NULL; } |