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;