mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-30 06:25:25 +03:00
journald: fix memory leak on error path
This commit is contained in:
parent
332076b45b
commit
26d8ff0491
@ -283,7 +283,11 @@ int journal_directory_vacuum(
|
||||
|
||||
patch_realtime(directory, p, &st, &realtime);
|
||||
|
||||
GREEDY_REALLOC(list, n_allocated, n_list + 1);
|
||||
if (!GREEDY_REALLOC(list, n_allocated, n_list + 1)) {
|
||||
free(p);
|
||||
r = -ENOMEM;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
list[n_list].filename = p;
|
||||
list[n_list].usage = 512UL * (uint64_t) st.st_blocks;
|
||||
|
Loading…
Reference in New Issue
Block a user