aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_disk_set_standard_lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_disk_set_standard_lookup.c')
-rw-r--r--libarchive/archive_write_disk_set_standard_lookup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libarchive/archive_write_disk_set_standard_lookup.c b/libarchive/archive_write_disk_set_standard_lookup.c
index 5c766d75dd01..5fccdb9dc658 100644
--- a/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/libarchive/archive_write_disk_set_standard_lookup.c
@@ -114,8 +114,7 @@ lookup_gid(void *private_data, const char *gname, int64_t gid)
return ((gid_t)b->id);
/* Free the cache slot for a new entry. */
- if (b->name != NULL)
- free(b->name);
+ free(b->name);
b->name = strdup(gname);
/* Note: If strdup fails, that's okay; we just won't cache. */
b->hash = h;
@@ -184,8 +183,7 @@ lookup_uid(void *private_data, const char *uname, int64_t uid)
return ((uid_t)b->id);
/* Free the cache slot for a new entry. */
- if (b->name != NULL)
- free(b->name);
+ free(b->name);
b->name = strdup(uname);
/* Note: If strdup fails, that's okay; we just won't cache. */
b->hash = h;