Fix bug 02/35702/2 accepted/tizen/tv/20150224.003349 accepted/tizen/tv/20150224.023344 submit/tizen/20150224.013750 submit/tizen_tv/20150223.132251
authorKim Tae Soo <taesoo46.kim@samsung.com>
Mon, 23 Feb 2015 13:19:07 +0000 (22:19 +0900)
committerKim Tae Soo <taesoo46.kim@samsung.com>
Mon, 23 Feb 2015 13:20:41 +0000 (22:20 +0900)
Change-Id: Iffcd3b78c543864a8181edc320e0d66a13e791e9
Signed-off-by: Kim Tae Soo <taesoo46.kim@samsung.com>
src/data/mediadata.cpp

index dae7067..9e9c04e 100644 (file)
@@ -218,12 +218,20 @@ bool CMediadata::m_HandleEachMediaData(media_info_h md_h)
        audio_meta_h audio_h = NULL;
        char* tmpStr = NULL;
        int tmpValue;
+       bool ret;
 
        sinfo = new CSongInfo;
+       if (!sinfo) {
+               _ERR("Memory alloc failed");
+               return false;
+       }
 
-       sinfo->Create();
-       if (!sinfo)
+       ret = sinfo->Create();
+       if (!ret) {
+               _ERR("CSongInfo creation failed");
+               delete sinfo;
                return false;
+       }
 
        if (media_info_get_file_path(md_h, &tmpStr)
                != MEDIA_CONTENT_ERROR_NONE) {
@@ -333,11 +341,14 @@ bool CMediadata::m_HandleEachFolderData(media_folder_h folder_h)
        bool ret;
 
        finfo = new CFolderInfo;
-       if (!finfo)
+       if (!finfo) {
+               _ERR("Memory alloc failed");
                return false;
+       }
 
        ret = finfo->Create();
        if (!ret) {
+               _ERR("CFolderInfo creation failed");
                delete finfo;
                return false;
        }
@@ -396,11 +407,14 @@ bool CMediadata::m_HandleEachAlbumData(media_album_h album_h)
        bool ret;
 
        alinfo = new CAlbumInfo;
-       if (!alinfo)
+       if (!alinfo) {
+               _ERR("Memory alloc failed");
                return false;
+       }
 
        ret = alinfo->Create();
        if (!ret) {
+               _ERR("CAlbumInfo creation failed");
                delete alinfo;
                return false;
        }
@@ -473,13 +487,23 @@ bool CMediadata::m_HandleEachPlaylist(media_playlist_h ph)
        CCategoryInfo *catinfo = NULL;
        char *tmpStr;
        int tmpValue;
+       bool ret;
 
        if (!ph)
                return false;
 
        catinfo = new CCategoryInfo;
-       if (!catinfo)
+       if (!catinfo) {
+               _ERR("Memory alloc failed");
                return false;
+       }
+
+       ret = catinfo->Create();
+       if (!ret) {
+               _ERR("CCategoryInfo Create failed");
+               delete catinfo;
+               return false;
+       }
 
        if (media_playlist_get_name(ph, &tmpStr) !=
                MEDIA_CONTENT_ERROR_NONE) {