]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_imagick] Coverity CID 1500258 (Resource leak) 2028/head
authorJakub Karolczyk <jakub.karolczyk@signalwire.com>
Thu, 6 Apr 2023 11:25:48 +0000 (12:25 +0100)
committerJakub Karolczyk <jakub.karolczyk@signalwire.com>
Thu, 6 Apr 2023 17:23:33 +0000 (18:23 +0100)
src/mod/formats/mod_imagick/mod_imagick.c

index beb60387bf4351ceecdd19747c1b3b93be3b2c79..5c185a5e44d7ad96e1c63bc31faba27c2230d05f 100644 (file)
@@ -384,6 +384,7 @@ static switch_status_t read_page(pdf_file_context_t *context)
                if (ret == MagickFalse && context->exception->severity != UndefinedException) {
                        CatchException(context->exception);
                        free(storage);
+
                        return SWITCH_STATUS_FALSE;
                }
 
@@ -397,6 +398,8 @@ static switch_status_t read_page(pdf_file_context_t *context)
 
                if (ret == MagickFalse && context->exception->severity != UndefinedException) {
                        CatchException(context->exception);
+                       switch_img_free(&img);
+
                        return SWITCH_STATUS_FALSE;
                }