]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
Fix stop function of NFCT plugin.
authorEric Leblond <eric@inl.fr>
Sat, 29 Nov 2008 20:07:08 +0000 (21:07 +0100)
committerEric Leblond <eric@inl.fr>
Tue, 9 Dec 2008 00:19:25 +0000 (01:19 +0100)
This patch fixes some crashes in NFCT plugin that were triggered
by the call of the destructor_nfct function (during stop).

input/flow/ulogd_inpflow_NFCT.c
src/hash.c

index a33ec355d45c8b92e17986b656cf51c9f9b99aa0..a39bf0899e21f952b759bfb7a9173ba84e954f8d 100644 (file)
@@ -884,7 +884,7 @@ static int constructor_nfct(struct ulogd_pluginstance *upi)
 
 static int destructor_nfct(struct ulogd_pluginstance *pi)
 {
-       struct nfct_pluginstance *cpi = (void *) pi;
+       struct nfct_pluginstance *cpi = (void *) pi->private;
        int rc;
 
        hashtable_destroy(cpi->ct_active);
index 33541e8e68718bc70f9967b394737e4af1762756..700678c73f77563b0a5b98925c388b569060e3e2 100644 (file)
@@ -75,8 +75,10 @@ hashtable_create(int hashsize, int limit, int datasize,
 
 void hashtable_destroy(struct hashtable *h)
 {
-       hashtable_flush(h);
-       free(h);
+       if (h) {
+               hashtable_flush(h);
+               free(h);
+       }
 }
 
 void *hashtable_add(struct hashtable *table, void *data)