X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudevadm-hwdb.c;fp=src%2Fudev%2Fudevadm-hwdb.c;h=16abbe8d2f3b29349d43c5670029a5ecec6fa609;hb=955d98c9c1104d469c2989dbfb58f58ee6fe9bdc;hp=a22de1da4dad67e3476dc128151a24472e97536a;hpb=7e2270246b0906675c8f34bc278b1608b969e65c;p=elogind.git diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c index a22de1da4..16abbe8d2 100644 --- a/src/udev/udevadm-hwdb.c +++ b/src/udev/udevadm-hwdb.c @@ -190,7 +190,7 @@ static int trie_insert(struct trie *trie, struct trie_node *node, const char *se continue; /* split node */ - new_child = calloc(sizeof(struct trie_node), 1); + new_child = new0(struct trie_node, 1); if (!new_child) return -ENOMEM; @@ -233,7 +233,7 @@ static int trie_insert(struct trie *trie, struct trie_node *node, const char *se ssize_t off; /* new child */ - child = calloc(sizeof(struct trie_node), 1); + child = new0(struct trie_node, 1); if (!child) return -ENOMEM; @@ -576,7 +576,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) { char **files, **f; _cleanup_free_ char *hwdb_bin = NULL; - trie = calloc(sizeof(struct trie), 1); + trie = new0(struct trie, 1); if (!trie) { rc = EXIT_FAILURE; goto out; @@ -590,7 +590,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) { } /* index */ - trie->root = calloc(sizeof(struct trie_node), 1); + trie->root = new0(struct trie_node, 1); if (!trie->root) { rc = EXIT_FAILURE; goto out;