aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2010-11-14 11:21:19 +0100
committermaximilian attems <max@stro.at>2010-11-14 11:21:19 +0100
commit264dda888400496630232abf7d6d945f97c72ed7 (patch)
tree098b9450260c4fa4a5caf1f96779b8a14cdcd0e4
parentd16a35c5afb729e9f958983c9256614e5a4ff582 (diff)
downloadklibc-264dda888400496630232abf7d6d945f97c72ed7.tar.gz
[klibc] cpio: remove useless if before free
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/utils/cpio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr/utils/cpio.c b/usr/utils/cpio.c
index 174d3629ed426..e9cd0b48da6c1 100644
--- a/usr/utils/cpio.c
+++ b/usr/utils/cpio.c
@@ -365,8 +365,7 @@ add_inode(unsigned long node_num, char *file_name, unsigned long major_num,
for (i = 0; i < hash_num; i++)
hash_insert(old_table[i]);
- if (old_table != NULL)
- free(old_table);
+ free(old_table);
}
/* Insert the new record and increment the count of elements in the
@@ -914,8 +913,7 @@ static void read_in_new_ascii(struct new_cpio_header *file_hdr, int in_des)
ah += 8;
}
/* Read file name from input. */
- if (file_hdr->c_name != NULL)
- free(file_hdr->c_name);
+ free(file_hdr->c_name);
file_hdr->c_name = (char *)xmalloc(file_hdr->c_namesize);
tape_buffered_read(file_hdr->c_name, in_des,
(long)file_hdr->c_namesize);