mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
basic/fileio: use malloc_usable_size() to use all allocated memory
This commit is contained in:
parent
a9899ff358
commit
f1a8a66c35
@ -426,6 +426,7 @@ int read_full_virtual_file(const char *filename, char **ret_contents, size_t *re
|
||||
buf = malloc(size + 1);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
size = malloc_usable_size(buf) - 1; /* Use a bigger allocation if we got it anyway */
|
||||
|
||||
for (;;) {
|
||||
ssize_t k;
|
||||
|
Loading…
x
Reference in New Issue
Block a user