Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstring.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/util/virstring.c b/src/util/virstring.c
index bc9b6cd40e..15c3f7bdd1 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1078,12 +1078,10 @@ void
virStringListRemoveDuplicates(char ***list)
{
size_t len = g_strv_length(*list);
- char **unique;
+ char **unique = g_new0(char *, len + 1);
size_t n = 0;
size_t i;
- unique = g_malloc0_n(len + 1, sizeof(char *));
-
for (i = 0; i < len; i++) {
if (n > 0 && STREQ_NULLABLE(unique[n - 1], (*list)[i]))
g_free((*list)[i]);
--
2.47.0