diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-06 15:04:01 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-09-07 02:23:14 +0900 |
commit | 1e19f5ac0d680a63eccae7ef1fc6ce225dca0bbf (patch) | |
tree | 46cef21b453bdc946158be036f17057b7d5e5482 /src/pstore | |
parent | 338009e0db675aec98fdd88f42e6f2279a1b518e (diff) | |
download | systemd-1e19f5ac0d680a63eccae7ef1fc6ce225dca0bbf.tar.gz |
pstore: fix use after free
The memory is still needed in the sd_journal_sendv() after the 'if' block.
Diffstat (limited to 'src/pstore')
-rw-r--r-- | src/pstore/pstore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c index c760b3e899..8ffe523830 100644 --- a/src/pstore/pstore.c +++ b/src/pstore/pstore.c @@ -117,6 +117,7 @@ static int compare_pstore_entries(const void *_a, const void *_b) { static int move_file(PStoreEntry *pe, const char *subdir) { _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL; + _cleanup_free_ void *field = NULL; const char *suffix, *message; struct iovec iovec[2]; int n_iovec = 0, r; @@ -138,7 +139,6 @@ static int move_file(PStoreEntry *pe, const char *subdir) { iovec[n_iovec++] = IOVEC_MAKE_STRING(message); if (pe->content_size > 0) { - _cleanup_free_ void *field = NULL; size_t field_size; field_size = strlen("FILE=") + pe->content_size; |