]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: fix OOM check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 19:55:34 +0000 (04:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 19:57:02 +0000 (04:57 +0900)
Follow-up for f1b6417fea8ea1fb9a57f45b845ab1db944eca23.
Fixes CID#1593167.

src/home/homed-manager-bus.c

index a3fe2b6a69a3daf6d55ed770e4c12da72513c772..bf252ce835c547a9e9ee9d69553525e05c939f43 100644 (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);