mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
pstore: fix use after free
The memory is still needed in the sd_journal_sendv() after the 'if' block.
This commit is contained in:
parent
338009e0db
commit
1e19f5ac0d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user