From: Yin Kangkai Date: Tue, 3 Aug 2010 06:10:26 +0000 (+0200) Subject: malloc()+memset() -> calloc() X-Git-Tag: 174~397 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27f4528b9a6587cab2d916fad735dd93eb7563b0;p=systemd malloc()+memset() -> calloc() --- 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);