remove useless if-before-free tests

Change "if (E) free (E);" to "free (E);" everywhere except in the
libgo/, intl/, zlib/ and classpath/ directories.
Also transform equivalent variants like
"if (E != NULL) free (E);" and allow an extra cast on the
argument to free.  Otherwise, the tested and freed "E"
expressions must be identical, modulo white space.

From-SVN: r172785
This commit is contained in:
Jim Meyering 2011-04-20 18:19:03 +00:00
parent 53eebfbf94
commit 046957830e
74 changed files with 267 additions and 270 deletions

View file

@ -1064,8 +1064,7 @@ replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro, macro_arg
/* Free the expanded arguments. */
for (i = 0; i < macro->paramc; i++)
if (args[i].expanded)
free (args[i].expanded);
free (args[i].expanded);
push_ptoken_context (pfile, node, buff, first, dest - first);
}