From 090b761fde79b5523b3d7b002704e013775524c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Thu, 20 Jun 2019 00:40:10 +0200 Subject: [PATCH] load_jpeg.c Removed dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch removes the code not used. Because the if block check that buffer[0] is NULL, then, we don't need check it again inside. Image is not used yet, so is NULL. We can return NULL. Signed-off-by: Rodolfo García Peñas (kix) --- wrlib/load_jpeg.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wrlib/load_jpeg.c b/wrlib/load_jpeg.c index 02d53a57..f4462704 100644 --- a/wrlib/load_jpeg.c +++ b/wrlib/load_jpeg.c @@ -139,15 +139,11 @@ RImage *RLoadJPEG(const char *file_name) } buffer[0] = (JSAMPROW) malloc(cinfo.image_width * cinfo.num_components); - if (!buffer[0]) { RErrorCode = RERR_NOMEMORY; jpeg_destroy_decompress(&cinfo); fclose(file); - if (buffer[0]) - free(buffer[0]); - - return image; + return NULL; } if (cinfo.jpeg_color_space == JCS_GRAYSCALE) {