Fix memory leak 66/227866/2 accepted/tizen/unified/20200318.130539 submit/tizen/20200316.031954 submit/tizen/20200317.020149
authorhj kim <backto.kim@samsung.com>
Tue, 17 Mar 2020 01:56:02 +0000 (10:56 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 17 Mar 2020 01:59:31 +0000 (10:59 +0900)
Change-Id: Iff3a0406cd65e598f58050a41bc20eedbba30496

src/media-thumbnail.c

index 8fe3eb2b58672f21ae38a0b412f6cf60d25af93f..2b986de674d39a2d3bc91739a3c125c9eeb58568 100755 (executable)
@@ -437,7 +437,10 @@ int create_video_thumbnail_to_file(const char *path, unsigned int width, unsigne
                rot_type = MM_UTIL_ROTATE_0;
 
        //Extract thumbnail
-       return __get_video_thumb_to_file(video_width, video_height, frame, frame_size, rot_type, thumb_path, width, height);
+       err = __get_video_thumb_to_file(video_width, video_height, frame, frame_size, rot_type, thumb_path, width, height);
+       g_free(frame);
+
+       return err;
 }
 
 int create_video_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height, bool auto_rotate)
@@ -468,6 +471,7 @@ int create_video_thumbnail_to_buffer(const char *path, unsigned int width, unsig
                err = mm_image_get_image(img, thumb_width, thumb_height, NULL, thumb_buffer, thumb_size);
 
        mm_image_destroy_image(img);
+       g_free(frame);
 
        return err;
 }