sleep-config: fix potential memory leak

Follow-up for 77bd39385e
This commit is contained in:
Mike Yuan
2024-03-28 17:16:24 +08:00
parent 0a3fd5ce43
commit a6fe020ab8
+2 -2
View File
@@ -69,8 +69,8 @@ static int config_parse_sleep_mode(
void *data,
void *userdata) {
_cleanup_strv_free_ char **modes = NULL;
char ***sv = ASSERT_PTR(data);
_cleanup_strv_free_ char **modes = NULL;
int r;
assert(filename);
@@ -87,7 +87,7 @@ static int config_parse_sleep_mode(
return log_oom();
}
return free_and_replace(*sv, modes);
return strv_free_and_replace(*sv, modes);
}
static void sleep_config_validate_state_and_mode(SleepConfig *sc) {