udev-rules: use new() macro instead of malloc_multiply()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Feb 2019 01:41:48 +0000 (10:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Feb 2019 03:22:54 +0000 (12:22 +0900)
src/udev/udev-rules.c

index b741d05..4d755ae 100644 (file)
@@ -1584,7 +1584,7 @@ int udev_rules_new(UdevRules **ret_rules, ResolveNameTiming resolve_name_timing)
         };
 
         /* init token array and string buffer */
-        rules->tokens = malloc_multiply(PREALLOC_TOKEN, sizeof(struct token));
+        rules->tokens = new(struct token, PREALLOC_TOKEN);
         if (!rules->tokens)
                 return -ENOMEM;
         rules->token_max = PREALLOC_TOKEN;