Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
// Fetch bus path
char* path = nw_port_bus_path(port);
+ // Append the port to the message
r = sd_bus_message_append(reply, "(so)", name, path);
+ if (r < 0)
+ goto ERROR;
- free(path);
+ // Success
+ r = 0;
+
+ERROR:
+ if (path)
+ free(path);
return r;
}
// Fetch bus path
char* path = nw_zone_bus_path(zone);
+ // Append the zone to the message
r = sd_bus_message_append(reply, "(so)", name, path);
+ if (r < 0)
+ goto ERROR;
- free(path);
+ // Success
+ r = 0;
+
+ERROR:
+ if (path)
+ free(path);
return r;
}