summaryrefslogtreecommitdiffstats
path: root/src/portable/portabled-image-bus.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-03-28 13:38:18 +0200
committerDavid Tardon <dtardon@redhat.com>2023-04-11 16:32:46 +0200
commit2b4b01b00ac9d0a5940316fa24cb7cd12fc3e757 (patch)
treed87173cb4e3e3a7afe55b7813cdebcce91773bd7 /src/portable/portabled-image-bus.c
parentportabled-bus: use CLEANUP_ARRAY (diff)
downloadsystemd-2b4b01b00ac9d0a5940316fa24cb7cd12fc3e757.tar.xz
systemd-2b4b01b00ac9d0a5940316fa24cb7cd12fc3e757.zip
portabled-image-bus: use CLEANUP_ARRAY
Diffstat (limited to 'src/portable/portabled-image-bus.c')
-rw-r--r--src/portable/portabled-image-bus.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/portabled-image-bus.c b/src/portable/portabled-image-bus.c
index 6c4cb6ec9d..1aec2783f1 100644
--- a/src/portable/portabled-image-bus.c
+++ b/src/portable/portabled-image-bus.c
@@ -316,6 +316,8 @@ int bus_image_common_attach(
assert(message);
assert(name_or_path || image);
+ CLEANUP_ARRAY(changes, n_changes, portable_changes_free);
+
if (!m) {
assert(image);
m = image->userdata;
@@ -390,13 +392,9 @@ int bus_image_common_attach(
&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 bus_image_method_attach(sd_bus_message *message, void *userdata, sd_bus_error *error) {