chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
332076b
)
journald: fix memory leak on error path
author
Lennart Poettering
<lennart@poettering.net>
Mon, 3 Nov 2014 22:10:34 +0000
(23:10 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 3 Nov 2014 22:10:34 +0000
(23:10 +0100)
src/journal/journal-vacuum.c
patch
|
blob
|
history
diff --git
a/src/journal/journal-vacuum.c
b/src/journal/journal-vacuum.c
index d141fe0ffb57800095704fee6b0e37dede6f7e5e..80723c47f06c5c7635cf3a55515f68dd32dab4b9 100644
(file)
--- 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;