portabled-image-bus: use CLEANUP_ARRAY

This commit is contained in:
David Tardon
2023-04-11 16:32:46 +02:00
parent 0dab8d5dc7
commit 2b4b01b00a
+4 -6
View File
@@ -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;
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 bus_image_method_attach(sd_bus_message *message, void *userdata, sd_bus_error *error) {