diff options
author | David Tardon <dtardon@redhat.com> | 2023-03-28 13:33:48 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2023-04-11 16:32:45 +0200 |
commit | 0dab8d5dc7828931f1679f51004359ae7e38d546 (patch) | |
tree | 8ebf9285edbd4f63e84d8e3407c72761f9627b08 /src | |
parent | bd92527752e05b62b53424fd3848e6ed880e7b26 (diff) | |
download | systemd-0dab8d5dc7828931f1679f51004359ae7e38d546.tar.gz |
portabled-bus: use CLEANUP_ARRAY
Diffstat (limited to 'src')
-rw-r--r-- | src/portable/portabled-bus.c | 10 |
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) { |