]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
xt: only unset fields if m is non NULL
authorDan McGee <dan@archlinux.org>
Wed, 31 Aug 2011 19:18:49 +0000 (12:18 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 31 Aug 2011 19:18:49 +0000 (12:18 -0700)
tc/m_xt.c

index 86e223bcc6199fff41067a0d9ad79c8873d952a7..18666b3eb53b4b545413da5d60ada5bec96ca25b 100644 (file)
--- 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;