NULL,
};
- _cleanup_free_ char *p = NULL, *q = NULL, *l = NULL;
+ _cleanup_free_ char *p = NULL, *q = NULL, *l = NULL, *v = NULL;
bool found_native = false, found_sysv;
const char *name;
unsigned c = 1;
argv[c++] = q;
}
- argv[c++] = verb;
+ /* Let's copy the verb, since it's still pointing directly into the original argv[] array we
+ * got passed, but safe_fork() is likely going to rewrite that for the new child */
+ v = strdup(verb);
+ if (!v)
+ return log_oom();
+
+ argv[c++] = v;
argv[c++] = basename(p);
argv[c] = NULL;