diff mbox

[ulogd,6/7] ulogd: update calling stop callback condition

Message ID 20160210020414.GG17470@gmail.com
State Deferred
Delegated to: Eric Leblond
Headers show

Commit Message

Ken-ichirou MATSUZAWA Feb. 10, 2016, 2:04 a.m. UTC
TIMECONV filter in previous patch has private data but does not
have stop callback, then segfault occured.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
---
 src/ulogd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/ulogd.c b/src/ulogd.c
index 5b9a586..7e1a42f 100644
--- a/src/ulogd.c
+++ b/src/ulogd.c
@@ -1288,13 +1288,13 @@  static void stop_pluginstances()
 
 	llist_for_each_entry(stack, &ulogd_pi_stacks, stack_list) {
 		llist_for_each_entry_safe(pi, npi, &stack->list, list) {
-			if ((pi->plugin->priv_size > 0 || *pi->plugin->stop) &&
-			    pluginstance_stop(pi)) {
+			if (*pi->plugin->stop && pluginstance_stop(pi)) {
 				ulogd_log(ULOGD_DEBUG, "calling stop for %s\n",
 					  pi->plugin->name);
 				(*pi->plugin->stop)(pi);
-				pi->private[0] = 0;
 			}
+			if (pi->plugin->priv_size > 0)
+				pi->private[0] = 0;
 			free(pi);
 		}
 	}