diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-27 19:09:22 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-03-02 12:39:07 +0100 |
commit | 62d74c78b59f95a76778d9fa8dbe3b098afa2aad (patch) | |
tree | 138ea4e336b01254a6766e547fdc10c3728255ef /src/basic/prioq.c | |
parent | 3209c8e6502c095bb7a88a3e915f06dd56228ed4 (diff) | |
download | systemd-62d74c78b59f95a76778d9fa8dbe3b098afa2aad.tar.gz |
coccinelle: add reallocarray() coccinelle script
Let's systematically make use of reallocarray() whereever we invoke
realloc() with a product of two values.
Diffstat (limited to 'src/basic/prioq.c')
-rw-r--r-- | src/basic/prioq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/prioq.c b/src/basic/prioq.c index 407b17e9bf..2a1f1af878 100644 --- a/src/basic/prioq.c +++ b/src/basic/prioq.c @@ -173,7 +173,7 @@ int prioq_put(Prioq *q, void *data, unsigned *idx) { struct prioq_item *j; n = MAX((q->n_items+1) * 2, 16u); - j = realloc(q->items, sizeof(struct prioq_item) * n); + j = reallocarray(q->items, n, sizeof(struct prioq_item)); if (!j) return -ENOMEM; |