jpg_loader JpgLoader: Prevent memory leak
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 9 Jul 2021 04:22:43 +0000 (13:22 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 9 Jul 2021 08:03:12 +0000 (17:03 +0900)
If the copied data in JpgLoader's data open is invalid,
it is processed without being cleared.
Therefore, data memory free is handled in the destructor.

src/loaders/jpg/tvgJpgLoader.cpp

index 15cbf72..e9daa9d 100755 (executable)
@@ -47,6 +47,7 @@ JpgLoader::JpgLoader()
 
 JpgLoader::~JpgLoader()
 {
+    if (data) tjFree(data);
     tjDestroy(jpegDecompressor);
     tjFree(image);
     image = NULL;