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-11-18 16:21:11 +0100 |
commit | 3bf38f07f0172b4698c205f72d923e9a37e53da7 (patch) | |
tree | 1e23d307e65c667da14558426872612ef8941ee8 /lib/sqfs/comp/compressor.c | |
parent | 844fdd42f03a633f1dbce5d90b2ecf44698cf8b0 (diff) |
libsqfs: Initialize the return value in sqfs_compressor_create
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; |