tree-wide: use reallocarray() where appropriate

This commit is contained in:
Lennart Poettering
2019-04-02 14:54:42 +02:00
parent 0c21dafb54
commit a7798cd81b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -675,7 +675,7 @@ static int insert_into_order(uint16_t slot, bool first) {
}
/* extend array */
t = realloc(order, (n + 1) * sizeof(uint16_t));
t = reallocarray(order, n + 1, sizeof(uint16_t));
if (!t)
return -ENOMEM;
order = t;
+1 -1
View File
@@ -818,7 +818,7 @@ _public_ int sd_get_uids(uid_t **users) {
uid_t *t;
n = MAX(16, 2*r);
t = realloc(l, sizeof(uid_t) * n);
t = reallocarray(l, sizeof(uid_t), n);
if (!t)
return -ENOMEM;