summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-03-28 13:33:48 +0200
committerDavid Tardon <dtardon@redhat.com>2023-04-11 16:32:45 +0200
commit0dab8d5dc7828931f1679f51004359ae7e38d546 (patch)
tree8ebf9285edbd4f63e84d8e3407c72761f9627b08 /src/portable
parentbd92527752e05b62b53424fd3848e6ed880e7b26 (diff)
downloadsystemd-0dab8d5dc7828931f1679f51004359ae7e38d546.tar.gz
portabled-bus: use CLEANUP_ARRAY
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portabled-bus.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/portabled-bus.c b/src/portable/portabled-bus.c
index 768964231a..0d5518060e 100644
--- a/src/portable/portabled-bus.c
+++ b/src/portable/portabled-bus.c
@@ -281,6 +281,8 @@ static int method_detach_image(sd_bus_message *message, void *userdata, sd_bus_e
assert(message);
+ CLEANUP_ARRAY(changes, n_changes, portable_changes_free);
+
/* Note that we do not redirect detaching to the image object here, because we want to allow that users can
* detach already deleted images too, in case the user already deleted an image before properly detaching
* it. */
@@ -339,13 +341,9 @@ static int method_detach_image(sd_bus_message *message, void *userdata, sd_bus_e
&n_changes,
error);
if (r < 0)
- goto finish;
-
- r = reply_portable_changes(message, changes, n_changes);
+ return r;
-finish:
- portable_changes_free(changes, n_changes);
- return r;
+ return reply_portable_changes(message, changes, n_changes);
}
static int method_reattach_image(sd_bus_message *message, void *userdata, sd_bus_error *error) {