From 27f4528b9a6587cab2d916fad735dd93eb7563b0 Mon Sep 17 00:00:00 2001 From: Yin Kangkai Date: Tue, 3 Aug 2010 08:10:26 +0200 Subject: [PATCH] malloc()+memset() -> calloc() --- udev/udev-rules.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 4b81a50a..52f121c2 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -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); -- 2.39.5