summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2019-09-22 09:51:28 +0000
committerjoerg <joerg@pkgsrc.org>2019-09-22 09:51:28 +0000
commit85efd7f8759590df15b06d680dc2c141a499d7d3 (patch)
tree89973fc4fc77a5c0ac5daa4ea8e0e1afbf23fbf5 /archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
parent3d58b3c8e51f686500fbe08fc5fea947dfa036b4 (diff)
downloadpkgsrc-85efd7f8759590df15b06d680dc2c141a499d7d3.tar.gz
Import libarchive 3.4.0KIENTZLE
Diffstat (limited to 'archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c')
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c b/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
index 5c766d75dd0..5fccdb9dc65 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/archivers/libarchive/files/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;