diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-04-02 14:50:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-04-02 14:54:42 +0200 |
commit | a7798cd81b11205811e8d6e848e23b8b285f2bd8 (patch) | |
tree | 35719d03660d0adb21a1aaba3d699aa3d2978720 | |
parent | 0c21dafb54dea7564c6a0f063492926f495006b9 (diff) | |
download | systemd-a7798cd81b11205811e8d6e848e23b8b285f2bd8.tar.gz |
tree-wide: use reallocarray() where appropriate
-rw-r--r-- | src/boot/bootctl.c | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-login/sd-login.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 381c234f3b..a7de3800fc 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -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; diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index 07f21e84de..0dc368e6e2 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -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; |