summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYin Kangkai <kangkai.yin@linux.intel.com>2010-08-03 08:10:26 +0200
committerKay Sievers <kay.sievers@vrfy.org>2010-08-03 08:10:26 +0200
commit27f4528b9a6587cab2d916fad735dd93eb7563b0 (patch)
tree7558a27bcd81e3175d3861913be62d8f4e9ed187
parent1851332c08e3f70ee172bbe5b153789da5df2df5 (diff)
malloc()+memset() -> calloc()
-rw-r--r--udev/udev-rules.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 4b81a50a8e..52f121c29a 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);