aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--uid.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/uid.c b/uid.c
index 01a33137..fbb314e3 100644
--- a/uid.c
+++ b/uid.c
@@ -298,13 +298,15 @@ struct idlist *save_str(struct idlist **idl, const char *str, flag st)
void free_str_list(struct idlist **idl)
/* free the given UID list */
{
- if (*idl == (struct idlist *)NULL)
- return;
+ struct idlist *i = *idl;
- free_str_list(&(*idl)->next);
- free ((*idl)->id);
- free(*idl);
- *idl = (struct idlist *)NULL;
+ while(i) {
+ struct idlist *t = i->next;
+ free(i->id);
+ free(i);
+ i = t;
+ }
+ *idl = 0;
}
void save_str_pair(struct idlist **idl, const char *str1, const char *str2)