]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: Minor fix to a cleanup function on an error path
authorPhilip Withnall <pwithnall@gnome.org>
Tue, 2 Jun 2026 11:59:04 +0000 (12:59 +0100)
committerPhilip Withnall <pwithnall@gnome.org>
Fri, 26 Jun 2026 12:01:09 +0000 (13:01 +0100)
`process_image()` has historically used `umount_and_freep` to clean up
the mounted directory locally, but callers to it have used
`umount_and_rmdir_and_freep`.

No directory is created after any of the error return paths in
`process_image()`, so it should probably be using
`umount_and_rmdir_and_freep` too.

src/sysupdate/sysupdate.c

index 3232ab6e3775e7a54390e3dafa8b698f49dd94d9..a4c68e48cfdd2395f4cd4d03d183962cc72c1193 100644 (file)
@@ -983,7 +983,7 @@ static int process_image(
                 ProcessImageFlags flags) {
 
         _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
-        _cleanup_(umount_and_freep) char *mounted_dir = NULL;
+        _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL;
         int r;
 
         assert(c);