Bug fix of bookmark. Add code of checking handle 15/125415/1 accepted/tizen/unified/20170418.072837 submit/tizen/20170417.081727
authorHaejeong Kim <backto.kim@samsung.com>
Mon, 17 Apr 2017 08:07:14 +0000 (17:07 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Mon, 17 Apr 2017 08:07:14 +0000 (17:07 +0900)
Change-Id: I8f5646bd290095bea6bee969aede058841708c45

packaging/capi-content-media-content.spec
src/media_bookmark.c

index 1d2f70b..e5bf2d5 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-content-media-content
 Summary:    A Media content library in Tizen Native API
-Version:    0.3.5
+Version:    0.3.6
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index a245784..fb20da7 100755 (executable)
@@ -213,11 +213,16 @@ int media_bookmark_set_name(media_bookmark_h bookmark, const char *name)
        int ret = MEDIA_CONTENT_ERROR_NONE;
        media_bookmark_s *_bookmark = (media_bookmark_s*)bookmark;
 
-       if (STRING_VALID(name)) {
-               _bookmark->name = g_strdup(name);
+       if (_bookmark != NULL) {
+               if (STRING_VALID(name))
+                       _bookmark->name = g_strdup(name);
+               else
+                       _bookmark->name = g_strdup(MEDIA_CONTENT_EMPTY_STRING);
+
                media_content_retvm_if(_bookmark->name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
        } else {
-               _bookmark->name = g_strdup(MEDIA_CONTENT_EMPTY_STRING);
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
        }
 
        return ret;