summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/files.c3
-rw-r--r--libcpp/init.c3
-rw-r--r--libcpp/macro.c3
-rw-r--r--libcpp/pch.c9
5 files changed, 13 insertions, 12 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index cfd07d4590b..eb93719e27b 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * files.c (destroy_cpp_file): Remove useless if-before-free.
+ * init.c (cpp_destroy): Likewise.
+ * macro.c (replace_args): Likewise.
+ * pch.c (cpp_valid_state): Likewise.
+
2011-03-25 Kai Tietz <ktietz@redhat.com>
* files.c (file_hash_eq): Use filename_cmp
diff --git a/libcpp/files.c b/libcpp/files.c
index e3cff498d8c..cd0bc4847b2 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -996,8 +996,7 @@ make_cpp_file (cpp_reader *pfile, cpp_dir *dir, const char *fname)
static void
destroy_cpp_file (_cpp_file *file)
{
- if (file->buffer_start)
- free ((void *) file->buffer_start);
+ free ((void *) file->buffer_start);
free ((void *) file->name);
free (file);
}
diff --git a/libcpp/init.c b/libcpp/init.c
index 5c6dacf205e..5ba666650e8 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -259,8 +259,7 @@ cpp_destroy (cpp_reader *pfile)
while (CPP_BUFFER (pfile) != NULL)
_cpp_pop_buffer (pfile);
- if (pfile->out.base)
- free (pfile->out.base);
+ free (pfile->out.base);
if (pfile->macro_buffer)
{
diff --git a/libcpp/macro.c b/libcpp/macro.c
index d9324a350ef..eba2349954a 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -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);
}
diff --git a/libcpp/pch.c b/libcpp/pch.c
index 00b7794ef1d..d278f14370e 100644
--- a/libcpp/pch.c
+++ b/libcpp/pch.c
@@ -713,12 +713,9 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
return -1;
fail:
- if (namebuf != NULL)
- free (namebuf);
- if (undeftab != NULL)
- free (undeftab);
- if (nl.defs != NULL)
- free (nl.defs);
+ free (namebuf);
+ free (undeftab);
+ free (nl.defs);
return 1;
}