summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/journal/journal-vacuum.c6
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;