summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/process.c b/process.c
index 166b769..a9466a7 100644
--- a/process.c
+++ b/process.c
@@ -1280,8 +1280,11 @@ remove_entry(const char *inputfilename, int lineno, Xauth *auth, char *data)
/*
* unlink the auth we were asked to
*/
- while (!eq_auth((list = *listp)->auth, auth))
- listp = &list->next;
+ while (!eq_auth((list = *listp)->auth, auth)) {
+ listp = &list->next;
+ if (!*listp)
+ return 0;
+ }
*listp = list->next;
XauDisposeAuth (list->auth); /* free the auth */
free (list); /* free the link */