In set_from_ui_generic(), free the (*ret) string list on the common path.
No functional change.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2124538
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
gui.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gui.c b/gui.c
index 4b98a44fbbe9..561ba64d2a71 100644
--- a/gui.c
+++ b/gui.c
@@ -1404,15 +1404,14 @@ set_from_ui_generic (char **all, char ***ret, GtkTreeView *list)
gboolean b, v;
size_t i, j;
+ guestfs_int_free_string_list (*ret);
if (all == NULL) {
- guestfs_int_free_string_list (*ret);
*ret = NULL;
return;
}
model = gtk_tree_view_get_model (list);
- guestfs_int_free_string_list (*ret);
*ret = malloc ((1 + guestfs_int_count_strings (all)) * sizeof (char *));
if (*ret == NULL)
error (EXIT_FAILURE, errno, "malloc");