xt: only unset fields if m is non NULL

This commit is contained in:
Dan McGee 2011-08-31 12:18:49 -07:00 committed by Stephen Hemminger
parent 9a230771c0
commit 4f3626f920
1 changed files with 8 additions and 6 deletions

View File

@ -252,13 +252,15 @@ static int parse_ipt(struct action_util *a,int *argc_p,
optind = 0;
xtables_free_opts(1);
if (m) {
/* Clear flags if target will be used again */
m->tflags=0;
m->used=0;
m->tflags = 0;
m->used = 0;
/* Free allocated memory */
if (m->t)
free(m->t);
}
return 0;