From 7a2e1a0a7a575c64eaf050c8ec08e5b36e4acfad Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 8 Apr 2021 12:04:33 +0200 Subject: 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 --- extras/mk42sqfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras/mk42sqfs.c') diff --git a/extras/mk42sqfs.c b/extras/mk42sqfs.c index 92323e0..08dffe6 100644 --- a/extras/mk42sqfs.c +++ b/extras/mk42sqfs.c @@ -167,7 +167,7 @@ int main(void) sqfs_meta_writer_get_position(inode_m, &block_start, &offset); super.root_inode_ref = (block_start << 16) | offset; sqfs_meta_writer_write_inode(inode_m, inode); - free(inode); + sqfs_free(inode); /* flush the meta data to the file */ sqfs_meta_writer_flush(inode_m); -- cgit v1.2.3