fix memory leak on testsuite 48/265548/1 submit/tizen/20211115.041112
authorJiyong Min <jiyong.min@samsung.com>
Wed, 20 Oct 2021 02:11:14 +0000 (11:11 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Wed, 20 Oct 2021 02:11:14 +0000 (11:11 +0900)
Change-Id: I6f604872f45cd2bfe15fbac6fbeff537905c43a9

test/heif_testsuite.c

index 21d4d2c..120471f 100644 (file)
@@ -378,6 +378,7 @@ static bool __test_decode(int mode)
                ret = heif_decode_image_from_buffer((unsigned char *)((void *)buffer), (size_t)size, g_color, &image);
                if (ret != LIBHEIF_ERROR_NONE) {
                        g_print("\t[HEIF_TEST] heif_decode_image_from_buffer fail %d\n", ret);
+                       g_free(buffer);
                        return false;
                }
 
@@ -442,6 +443,7 @@ static bool __test_thumb(int mode)
                ret = heif_decode_thumb_from_buffer((unsigned char *)((void *)buffer), (size_t)size, g_color, &thumbnail);
                if (ret != LIBHEIF_ERROR_NONE) {
                        g_print("\t[HEIF_TEST] heif_decode_thumb_from_buffer fail %d\n", ret);
+                       g_free(buffer);
                        return false;
                }