summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b349bc5)
Another fall-out from our rewriting of argv[] now.
Fixes: #12782
static char* arg_verb = NULL;
static char* arg_verb = NULL;
+STATIC_DESTRUCTOR_REGISTER(arg_verb, freep);
+
static int write_hibernate_location_info(void) {
_cleanup_free_ char *device = NULL, *type = NULL;
_cleanup_free_ struct fiemap *fiemap = NULL;
static int write_hibernate_location_info(void) {
_cleanup_free_ char *device = NULL, *type = NULL;
_cleanup_free_ struct fiemap *fiemap = NULL;
"Usage: %s COMMAND",
program_invocation_short_name);
"Usage: %s COMMAND",
program_invocation_short_name);
- arg_verb = argv[optind];
+ arg_verb = strdup(argv[optind]);
+ if (!arg_verb)
+ return log_oom();
if (!STR_IN_SET(arg_verb, "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate"))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
if (!STR_IN_SET(arg_verb, "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate"))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),