From 07cf7fd48e261214020b4b3a015276a0a4a2d0f3 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Thu, 29 Aug 2019 17:16:38 +0900 Subject: [PATCH] Remove G_SAFE_FREE Change-Id: Icf1728faa7ea6237e56a8c69b675faa59aff0627 Signed-off-by: Minje Ahn --- src/common/media-svc-storage.c | 6 +++--- src/common/media-svc-util.c | 2 +- src/include/common/media-svc-util.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/media-svc-storage.c b/src/common/media-svc-storage.c index 062c56b..f891e36 100755 --- a/src/common/media-svc-storage.c +++ b/src/common/media-svc-storage.c @@ -104,7 +104,7 @@ int _media_svc_update_storage_path(sqlite3 *handle, const char *storage_id, cons ret = _media_svc_sql_query_direct(sql, uid); SQLITE3_SAFE_FREE(sql); if (ret != MS_MEDIA_ERR_NONE) { - G_SAFE_FREE(old_storage_path); + g_free(old_storage_path); return ret; } @@ -113,7 +113,7 @@ int _media_svc_update_storage_path(sqlite3 *handle, const char *storage_id, cons ret = _media_svc_sql_query_direct(sql, uid); SQLITE3_SAFE_FREE(sql); if (ret != MS_MEDIA_ERR_NONE) { - G_SAFE_FREE(old_storage_path); + g_free(old_storage_path); return ret; } @@ -121,7 +121,7 @@ int _media_svc_update_storage_path(sqlite3 *handle, const char *storage_id, cons sql = sqlite3_mprintf("UPDATE '%q' SET media_path=REPLACE(media_path, %Q, %Q);", storage_id, old_storage_path, path); ret = _media_svc_sql_query_direct(sql, uid); SQLITE3_SAFE_FREE(sql); - G_SAFE_FREE(old_storage_path); + g_free(old_storage_path); media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret); return ret; diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index aee15e0..d6d1347 100755 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -1403,7 +1403,7 @@ int _media_svc_extract_media_metadata(sqlite3 *handle, bool is_direct, media_svc /* Remove compensation string */ if (strlen(content_info->media_meta.recorded_date) > MEDIA_SVC_DEFAULT_FORMAT_LEN) { content_info->media_meta.datetaken = g_strndup(content_info->media_meta.recorded_date, MEDIA_SVC_DEFAULT_FORMAT_LEN); - G_SAFE_FREE(content_info->media_meta.recorded_date); + g_free(content_info->media_meta.recorded_date); content_info->media_meta.recorded_date = g_strdup(content_info->media_meta.datetaken); } else { content_info->media_meta.datetaken = g_strdup(content_info->media_meta.recorded_date); diff --git a/src/include/common/media-svc-util.h b/src/include/common/media-svc-util.h index 6884d39..f8a5e7a 100755 --- a/src/include/common/media-svc-util.h +++ b/src/include/common/media-svc-util.h @@ -35,7 +35,6 @@ extern "C" { #endif #define SAFE_FREE(src) { if (src) {free(src); src = NULL; } } -#define G_SAFE_FREE(src) { if (src) {g_free(src); src = NULL; } } #define STRING_VALID(str) \ ((str != NULL && strlen(str) > 0) ? true : false) -- 2.7.4