map_string_t *clone_map_string(map_string_t *ms) { if (ms == NULL) return NULL; map_string_t *clone = new_map_string(); const char *key; const char *value; map_string_iter_t iter; init_map_string_iter(&iter, ms); while(next_map_string_iter(&iter, &key, &value)) insert_map_string(clone, xstrdup(key), xstrdup(value)); return clone; }
static bool problem_data_get_osinfo_from_items(problem_data_t *problem_data, map_string_t *osinfo, const char *osinfo_name, const char *release_name) { char *data = problem_data_get_content_or_NULL(problem_data, osinfo_name); if (data) { parse_osinfo(data, osinfo); return true; } data = problem_data_get_content_or_NULL(problem_data, release_name); if (!data) return false; insert_map_string(osinfo, xstrdup(OSINFO_PRETTY_NAME), xstrdup(data)); return true; }