summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-05-12 07:54:10 +0000
committerJim Meyering <jim@meyering.net>2005-05-12 07:54:10 +0000
commit258fbb886034baf260e1a5ed5c3446cce9fa6fb4 (patch)
tree611c0b524410f7ca65cf0a8af748fa052f231254
parentc73cf112919e9b66189cc67303203e5d0612ba86 (diff)
downloadcoreutils-258fbb886034baf260e1a5ed5c3446cce9fa6fb4.tar.xz
Assume `free (NULL)' works.
-rw-r--r--src/dd.c3
-rw-r--r--src/df.c3
-rw-r--r--src/dircolors.c3
-rw-r--r--src/head.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/src/dd.c b/src/dd.c
index 9c7c96cfe..26929bdcb 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1543,8 +1543,7 @@ dd_copy (void)
}
free (real_buf);
- if (real_obuf)
- free (real_obuf);
+ free (real_obuf);
if ((conversions_mask & C_FDATASYNC) && fdatasync (STDOUT_FILENO) != 0)
{
diff --git a/src/df.c b/src/df.c
index 176f89b89..49de58c41 100644
--- a/src/df.c
+++ b/src/df.c
@@ -591,8 +591,7 @@ show_point (const char *point, const struct stat *statp)
}
}
- if (resolved)
- free (resolved);
+ free (resolved);
if (best_match
&& (stat (best_match->me_mountdir, &disk_stats) != 0
diff --git a/src/dircolors.c b/src/dircolors.c
index 1253980d0..1dbe6c4b4 100644
--- a/src/dircolors.c
+++ b/src/dircolors.c
@@ -364,8 +364,7 @@ dc_parse_stream (FILE *fp, const char *filename)
}
free (keywd);
- if (arg)
- free (arg);
+ free (arg);
}
return ok;
diff --git a/src/head.c b/src/head.c
index 3b54e8849..253ace50e 100644
--- a/src/head.c
+++ b/src/head.c
@@ -392,8 +392,7 @@ elide_tail_bytes_pipe (const char *filename, int fd, uintmax_t n_elide_0)
free_mem:;
for (i = 0; i < n_bufs; i++)
- if (b[i])
- free (b[i]);
+ free (b[i]);
free (b);
return ok;