Fix libchdr warning (#14658)

This commit is contained in:
sonninnos 2022-11-22 15:44:56 +02:00 committed by GitHub
parent 3e661ea42e
commit aeaf5561bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,9 +174,9 @@ chd_error zlib_codec_init(void *codec, uint32_t hunkbytes)
else
err = CHDERR_NONE;
/* handle an error */
if (err != CHDERR_NONE)
free(data);
/* handle an error */
if (err != CHDERR_NONE)
zlib_codec_free(data);
return err;
}
@ -194,7 +194,7 @@ void zlib_codec_free(void *codec)
if (data != NULL)
{
int i;
zlib_allocator alloc;
zlib_allocator alloc;
inflateEnd(&data->inflater);
@ -229,7 +229,7 @@ chd_error zlib_codec_decompress(void *codec, const uint8_t *src, uint32_t comple
/* do it */
zerr = inflate(&data->inflater, Z_FINISH);
(void)zerr;
(void)zerr;
if (data->inflater.total_out != destlen)
return CHDERR_DECOMPRESSION_ERROR;
@ -270,7 +270,7 @@ voidpf zlib_fast_alloc(voidpf opaque, uInt items, uInt size)
}
/* alloc a new one */
ptr = (UINT32 *)malloc(size + sizeof(UINT32) + ZLIB_MIN_ALIGNMENT_BYTES);
ptr = (UINT32 *)malloc(size + sizeof(UINT32) + ZLIB_MIN_ALIGNMENT_BYTES);
if (!ptr)
return NULL;