From: Dan McGee Date: Wed, 31 Aug 2011 19:18:49 +0000 (-0700) Subject: xt: only unset fields if m is non NULL X-Git-Tag: v3.0.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3626f9206b8a23637a3c36ec28db1e895850d4;p=thirdparty%2Fiproute2.git xt: only unset fields if m is non NULL --- diff --git a/tc/m_xt.c b/tc/m_xt.c index 86e223bcc..18666b3eb 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;