aboutsummaryrefslogtreecommitdiff
path: root/bin/sqfs2tar/xattr.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-04-08 12:04:33 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-04-08 12:04:33 +0200
commita3739ada111bf4e36ae7576b24176d1db55e1365 (patch)
treea7c0eee1aacf91137c6f163a7dc301cf114125ff /bin/sqfs2tar/xattr.c
parent7c6c0c07dda1f44b930ee2dbb9451979b6a2cb83 (diff)
Fix: libsquashfs: add sqfs_free() function
On systems like Windows, the dynamic library and applications can easily end up being linked against different runtime libraries, so applications cannot be expected to be able to free() any malloc'd pointer that the library returns. This commit adds an sqfs_free function so the application can pass pointers back to the library to call the correct free() implementation. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/sqfs2tar/xattr.c')
-rw-r--r--bin/sqfs2tar/xattr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/sqfs2tar/xattr.c b/bin/sqfs2tar/xattr.c
index 9a9ec82..abec4fb 100644
--- a/bin/sqfs2tar/xattr.c
+++ b/bin/sqfs2tar/xattr.c
@@ -68,13 +68,13 @@ int get_xattrs(const char *name, const sqfs_inode_generic_t *inode,
ret = sqfs_xattr_reader_read_value(xr, key, &value);
if (ret) {
sqfs_perror(name, "reading xattr value", ret);
- free(key);
+ sqfs_free(key);
goto fail;
}
ent = mkxattr(key, value);
- free(key);
- free(value);
+ sqfs_free(key);
+ sqfs_free(value);
if (ent == NULL)
goto fail;