storage_type = ms_get_storage_type_by_full(scan_data->msg, scan_data->uid);
update_path = strndup(scan_data->msg, scan_data->msg_size);
- if (strlen(scan_data->storage_id) > 0)
+ if (strlen(scan_data->storage_id) > 0) {
+ /*MS_DBG("path : [%s], storage_id : [%s]", scan_data->msg, scan_data->storage_id);*/
storage_id = strdup(scan_data->storage_id);
- else
- storage_id = strdup("media");
+ } else {
+ MS_DBG_ERR("storage_id length is 0. There is no information of your request [%s]", scan_data->msg);
+ ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+ goto NEXT;
+ }
+
+ if (storage_id == NULL) {
+ MS_DBG_ERR("storage_id NULL");
+ ret = MS_MEDIA_ERR_INVALID_PARAMETER;
+ goto NEXT;
+ }
ret = ms_set_storage_scan_status(handle, storage_id, MEDIA_SCAN_PROCESSING, scan_data->uid);
if (ret != MS_MEDIA_ERR_NONE) {