summaryrefslogtreecommitdiff
path: root/e2fsck/profile.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2009-02-23 18:07:50 +0100
committerTheodore Ts'o <tytso@mit.edu>2009-03-08 20:37:12 -0400
commit45e338f5332a54295893dba2e32cc093d1316f60 (patch)
treef20a569662c01e9330b33ea9fd8baa83c7601473 /e2fsck/profile.c
parenta6d4aa147415acf875300176c5ca98ca72594bec (diff)
downloade2fsprogs-45e338f5332a54295893dba2e32cc093d1316f60.tar.gz
remove useless if-before-free tests
In case you're wondering about whether this change is safe from a portability standpoint, fear not. This has been beaten to death in other forums. Here are a few threads: http://thread.gmane.org/gmane.comp.version-control.git/74187 http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712 http://thread.gmane.org/gmane.emacs.devel/98144 http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092 There has been debate about whether it's a good idea from a performance standpoint, too, but imho you'll have a hard time finding an instance where this sort of change induces a measurable performance penalty. If you do, please let me know. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/profile.c')
-rw-r--r--e2fsck/profile.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/e2fsck/profile.c b/e2fsck/profile.c
index ef439f2a..5e9dc531 100644
--- a/e2fsck/profile.c
+++ b/e2fsck/profile.c
@@ -603,8 +603,7 @@ void profile_free_file(prf_file_t prf)
{
if (prf->root)
profile_free_node(prf->root);
- if (prf->filespec)
- free(prf->filespec);
+ free(prf->filespec);
free(prf);
}
@@ -1049,10 +1048,8 @@ void profile_free_node(struct profile_node *node)
if (node->magic != PROF_MAGIC_NODE)
return;
- if (node->name)
- free(node->name);
- if (node->value)
- free(node->value);
+ free(node->name);
+ free(node->value);
for (child=node->first_child; child; child = next) {
next = child->next;