]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hardlink: use xcalloc rather than xmalloc
authorKarel Zak <kzak@redhat.com>
Wed, 17 Apr 2024 10:43:30 +0000 (12:43 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Apr 2024 10:43:30 +0000 (12:43 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/hardlink.c

index 89046a9f75194a11841f744b871f55289406c7f5..56316624277001d0fba6fd1c7e69b04315b594a8 100644 (file)
@@ -508,7 +508,7 @@ static int cmp_xattr_name_ptrs(const void *ptr1, const void *ptr2)
  */
 static const char **get_sorted_xattr_name_table(const char *names, int n)
 {
-       const char **table = xmalloc(n * sizeof(char *));
+       const char **table = xcalloc(n, sizeof(char *));
        int i;
 
        for (i = 0; i < n; i++) {