con_mark: fix heap-use-after-free
This commit is contained in:
parent
0d1aad0af4
commit
08976f7a2a
|
@ -608,7 +608,8 @@ void con_mark(Con *con, const char *mark, mark_mode_t mode) {
|
||||||
DLOG("Removing all existing marks on con = %p.\n", con);
|
DLOG("Removing all existing marks on con = %p.\n", con);
|
||||||
|
|
||||||
mark_t *current;
|
mark_t *current;
|
||||||
TAILQ_FOREACH(current, &(con->marks_head), marks) {
|
while (!TAILQ_EMPTY(&(con->marks_head))) {
|
||||||
|
current = TAILQ_FIRST(&(con->marks_head));
|
||||||
con_unmark(con, current->name);
|
con_unmark(con, current->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue