1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

tree-wide: use reallocarray() where appropriate

This commit is contained in:
Lennart Poettering 2019-04-02 14:50:15 +02:00
parent 0c21dafb54
commit a7798cd81b
2 changed files with 2 additions and 2 deletions

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;

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;