1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

journald: fix memory leak on error path

This commit is contained in:
Lennart Poettering 2014-11-03 23:10:34 +01:00
parent 332076b45b
commit 26d8ff0491
Notes: Lennart Poettering 2014-11-04 18:11:03 +01:00
Backport: bugfix

View File

@ -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;