]> err.no Git - systemd/commitdiff
malloc()+memset() -> calloc()
authorYin Kangkai <kangkai.yin@linux.intel.com>
Tue, 3 Aug 2010 06:10:26 +0000 (08:10 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 3 Aug 2010 06:10:26 +0000 (08:10 +0200)
udev/udev-rules.c

index 4b81a50a8e04a72d7e4be013042a96b7451069b9..52f121c29a73181eaac0db3292cc90be49ec2df1 100644 (file)
@@ -1751,10 +1751,9 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
        struct udev_list_entry *file_loop, *file_tmp;
        struct token end_token;
 
-       rules = malloc(sizeof(struct udev_rules));
+       rules = calloc(1, sizeof(struct udev_rules));
        if (rules == NULL)
                return NULL;
-       memset(rules, 0x00, sizeof(struct udev_rules));
        rules->udev = udev;
        rules->resolve_names = resolve_names;
        udev_list_init(&file_list);