summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/session.c b/session.c
index 72297ad..8408992 100644
--- a/session.c
+++ b/session.c
@@ -151,23 +151,21 @@ sessionRemoveWindowListItem (SessionWindowList *item)
SESSION_CORE (&core);
- if (!sc->windowList)
- return;
-
if (sc->windowList == item)
sc->windowList = item->next;
else
{
- for (run = sc->windowList; run->next; run = run->next)
+ for (run = sc->windowList; run && run->next; run = run->next)
{
if (run->next == item)
{
run->next = item->next;
- sessionFreeWindowListItem (item);
break;
}
}
}
+
+ sessionFreeWindowListItem (item);
}
static char*