diff options
Diffstat (limited to 'src/journal/journal-vacuum.c')
-rw-r--r-- | src/journal/journal-vacuum.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c index d141fe0ffb..80723c47f0 100644 --- a/src/journal/journal-vacuum.c +++ b/src/journal/journal-vacuum.c @@ -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; |