+static int mangle_names(char **original_names, char ***mangled_names) {
+ char **names_it = NULL;
+ char **name = NULL;
+
+ (*mangled_names) = new(char*, strv_length(original_names)+1);
+ if(!(*mangled_names))
+ return log_oom();
+
+ names_it = *mangled_names;
+
+ STRV_FOREACH(name, original_names) {
+ char *n = unit_name_mangle(*name);
+ (*names_it) = n ? n : strdup(*name);
+ if(!(*names_it))
+ return log_oom();
+ names_it++;
+ }
+ *names_it = NULL;
+
+ return 0;
+}
+