diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-11-18 15:35:04 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-12-01 18:46:52 +0100 |
commit | 35170bc6adf5d140210bc26e8511cf1e1cdeb5db (patch) | |
tree | 9d480f4cbe4cbf5833dfd5c07d5e88d57039dde4 /lib/sqfs/comp/compressor.c | |
parent | 9ae118f7c68785e3854cf68baf3177a94b70e0d6 (diff) |
libsqfs: Initialize the return value in sqfs_compressor_createfixes-1.1.0
Initialize the output compressor pointer to NULL, so if the function
fails, the value is propperly initialized to a NULL pointer instead
of relying on the function user to initialize it.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/compressor.c')
-rw-r--r-- | lib/sqfs/comp/compressor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c index f079651..4c4d73c 100644 --- a/lib/sqfs/comp/compressor.c +++ b/lib/sqfs/comp/compressor.c @@ -92,6 +92,8 @@ int sqfs_compressor_create(const sqfs_compressor_config_t *cfg, sqfs_u8 padd0[sizeof(cfg->opt)]; int ret; + *out = NULL; + /* check compressor ID */ if (cfg == NULL) return SQFS_ERROR_ARG_INVALID; |