mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
util: use alloca0() intead of alloca() + memzero()
This commit is contained in:
parent
c07aeadfea
commit
fb818b2ea1
@ -41,8 +41,7 @@ static PyObject *journal_sendv(PyObject *self, PyObject *args) {
|
||||
|
||||
/* Allocate an array for the argument strings */
|
||||
argc = PyTuple_Size(args);
|
||||
encoded = alloca(argc * sizeof(PyObject*));
|
||||
memzero(encoded, argc * sizeof(PyObject*));
|
||||
encoded = alloca0(argc * sizeof(PyObject*));
|
||||
|
||||
/* Allocate sufficient iovector space for the arguments. */
|
||||
iov = alloca(argc * sizeof(struct iovec));
|
||||
|
@ -129,8 +129,7 @@ static int pack_file(FILE *pack, const char *fn, bool on_btrfs) {
|
||||
}
|
||||
|
||||
pages = l / page_size();
|
||||
vec = alloca(pages);
|
||||
memzero(vec, pages);
|
||||
vec = alloca0(pages);
|
||||
if (mincore(start, l, vec) < 0) {
|
||||
log_warning("mincore(%s) failed: %m", fn);
|
||||
r = -errno;
|
||||
|
Loading…
Reference in New Issue
Block a user