From: jiyong.min Date: Tue, 25 Aug 2020 07:23:51 +0000 (+0900) Subject: Fix memory leak for invalid picture path X-Git-Tag: submit/tizen/20200827.012435^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c26c36b6dc210c3bb04646ae796a5d72f840748c;p=platform%2Fcore%2Fapi%2Fmetadata-editor.git Fix memory leak for invalid picture path Change-Id: I91cc461446c8a98ecc18959a31c8d2c39b7afd5b --- diff --git a/packaging/capi-media-metadata-editor.spec b/packaging/capi-media-metadata-editor.spec index fc80a35..45056c2 100755 --- a/packaging/capi-media-metadata-editor.spec +++ b/packaging/capi-media-metadata-editor.spec @@ -1,6 +1,6 @@ Name: capi-media-metadata-editor Summary: A metadata editor library in Tizen Native API -Version: 0.2.1 +Version: 0.2.2 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index 048986c..17a6478 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -556,8 +556,9 @@ static int __metadata_editor_get_picture_info(const char *path, char **picture, { int ret = METADATA_EDITOR_ERROR_NONE; GError *error = NULL; + char *mime_type = NULL; - ret = __metadata_editor_get_picture_type(path, type); + ret = __metadata_editor_get_picture_type(path, &mime_type); if (ret != METADATA_EDITOR_ERROR_NONE) return ret; @@ -569,8 +570,13 @@ static int __metadata_editor_get_picture_info(const char *path, char **picture, ret = METADATA_EDITOR_ERROR_PERMISSION_DENIED; g_error_free (error); + g_free(mime_type); + + return ret; } + *type = mime_type; + return ret; }