diff options
Diffstat (limited to 'common/strlist.c')
-rw-r--r-- | common/strlist.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/strlist.c b/common/strlist.c index 2ba0209f9..319d034e2 100644 --- a/common/strlist.c +++ b/common/strlist.c @@ -39,6 +39,7 @@ #include "common-defs.h" #include "strlist.h" #include "utf8conv.h" +#include "mischelp.h" void free_strlist( strlist_t sl ) @@ -52,6 +53,19 @@ free_strlist( strlist_t sl ) } +void +free_strlist_wipe (strlist_t sl) +{ + strlist_t sl2; + + for(; sl; sl = sl2 ) { + sl2 = sl->next; + wipememory (sl, sizeof *sl + strlen (sl->d)); + xfree(sl); + } +} + + /* Add STRING to the LIST at the front. This function terminates the process on memory shortage. */ strlist_t |