Added missing reset of journal cursor

In one case there was possibility of free()'d value of journal
cursor not being reset, causing double-free and crash later on.
This commit is contained in:
Jiri Vymazal 2019-03-11 15:49:36 +01:00
parent e25edc8354
commit 9123293a2f

View File

@ -474,6 +474,7 @@ persistJournalState(void)
free(last_cursor);
if ((ret = sd_journal_get_cursor(j, &last_cursor))) {
LogError(-ret, RS_RET_ERR, "imjournal: sd_journal_get_cursor() failed");
last_cursor = NULL;
ABORT_FINALIZE(RS_RET_ERR);
}
}