From 0dab8d5dc7828931f1679f51004359ae7e38d546 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 28 Mar 2023 13:33:48 +0200 Subject: [PATCH] portabled-bus: use CLEANUP_ARRAY --- src/portable/portabled-bus.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/portable/portabled-bus.c b/src/portable/portabled-bus.c index 768964231a1..0d5518060eb 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; + return r; - r = reply_portable_changes(message, changes, n_changes); - -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) {