From e799defcb888f583efc43612d657b2ee4d37ed27 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 23 Sep 2016 02:50:29 +0200 Subject: [PATCH] Cleanup --- tasks/task_image.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tasks/task_image.c b/tasks/task_image.c index f4ee341d11..f5605423af 100644 --- a/tasks/task_image.c +++ b/tasks/task_image.c @@ -199,19 +199,20 @@ static void task_image_load_free_internal(nbio_handle_t *nbio) { struct nbio_image_handle *image = (struct nbio_image_handle*)nbio->data; - if (image) { - image_transfer_free(image->handle, nbio->image_type); + if (!image) + return; - image->handle = NULL; - image->cb = NULL; + image_transfer_free(image->handle, nbio->image_type); - free(image); - } + image->handle = NULL; + image->cb = NULL; + + free(image); } static int cb_nbio_generic(nbio_handle_t *nbio, size_t *len) { - void *ptr = NULL; + void *ptr = NULL; struct nbio_image_handle *image = (struct nbio_image_handle*)nbio->data; if (!image || !image->handle) @@ -320,7 +321,7 @@ bool task_push_image_load(const char *fullpath, nbio_handle_t *nbio = NULL; retro_task_t *t = NULL; struct nbio_t *handle = NULL; - struct nbio_image_handle *image = NULL; + struct nbio_image_handle *image = NULL; if (enum_idx == MSG_UNKNOWN) goto error_msg;