homed: fix OOM check

Follow-up for f1b6417fea.
Fixes CID#1593167.
This commit is contained in:
Yu Watanabe
2025-03-13 04:55:34 +09:00
parent 26835b3e98
commit 55b13141fc

View File

@@ -993,7 +993,7 @@ static int method_add_signing_key(sd_bus_message *message, void *userdata, sd_bu
return log_error_errno(r, "Failed to convert public key to PEM: %m");
_cleanup_free_ char *fn_copy = strdup(fn);
if (!fn)
if (!fn_copy)
return log_oom();
_cleanup_free_ char *p = path_join("/var/lib/systemd/home/", fn);