From 3bafe5eac5b48193607c4617f32d9e5e2075189f Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 29 Mar 2016 13:07:09 +0200 Subject: decompressors: Use malloc/free wrappers The decompressors are used both in a regular image and also for image decompression. Both need different malloc implementations. Using malloc/free directly in the decompressor code easily leads to include file conflicts, so use MALLOC/FREE which can be defined correctly for the two different usecases. Signed-off-by: Sascha Hauer --- lib/xz/xz_private.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/xz/xz_private.h') diff --git a/lib/xz/xz_private.h b/lib/xz/xz_private.h index 99b8ade6cf..85f79635f0 100644 --- a/lib/xz/xz_private.h +++ b/lib/xz/xz_private.h @@ -39,6 +39,8 @@ # endif # define memeq(a, b, size) (memcmp(a, b, size) == 0) # define memzero(buf, size) memset(buf, 0, size) +# define FREE free +# define MALLOC malloc # endif # define get_le32(p) le32_to_cpup((const uint32_t *)(p)) #else @@ -150,7 +152,7 @@ XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s, struct xz_buf *b); /* Free the memory allocated for the BCJ filters. */ -#define xz_dec_bcj_end(s) kfree(s) +#define xz_dec_bcj_end(s) FREE(s) #endif #endif -- cgit v1.2.3