From 4f3626f9206b8a23637a3c36ec28db1e895850d4 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 31 Aug 2011 12:18:49 -0700 Subject: [PATCH] xt: only unset fields if m is non NULL --- tc/m_xt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index 86e223bc..18666b3e 100644 --- a/tc/m_xt.c +++ b/tc/m_xt.c @@ -252,13 +252,15 @@ static int parse_ipt(struct action_util *a,int *argc_p, optind = 0; xtables_free_opts(1); - /* Clear flags if target will be used again */ - m->tflags=0; - m->used=0; - /* Free allocated memory */ - if (m->t) - free(m->t); + if (m) { + /* Clear flags if target will be used again */ + m->tflags = 0; + m->used = 0; + /* Free allocated memory */ + if (m->t) + free(m->t); + } return 0;