1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

virstring: Use 'g_new0' instead of improper use of 'g_malloc0_n'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-10-25 09:45:19 +02:00
parent bb4bd9d31f
commit d02140383d

@ -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]);