aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-01-19 03:28:09 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-01-19 03:28:09 +0000
commit025dc8b68e812f4cdb0943baf8d43d3683651490 (patch)
tree35bb1439053926178a668849eb6c110f5a9ac545
parentd96713abf9221237b0acf9fc29fc2555a62af50a (diff)
downloadfetchmail-025dc8b68e812f4cdb0943baf8d43d3683651490.tar.gz
fetchmail-025dc8b68e812f4cdb0943baf8d43d3683651490.tar.bz2
fetchmail-025dc8b68e812f4cdb0943baf8d43d3683651490.zip
Implement free_netrc(list).
svn path=/branches/BRANCH_6-3/; revision=4659
-rw-r--r--netrc.c14
-rw-r--r--netrc.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/netrc.c b/netrc.c
index 765f5f1d..6c68d2c0 100644
--- a/netrc.c
+++ b/netrc.c
@@ -310,6 +310,18 @@ search_netrc (list, host, login)
return list;
}
+void
+free_netrc(netrc_entry *a) {
+ while(a) {
+ netrc_entry *n = a->next;
+ memset(a->password, 0x55, strlen(a->password));
+ xfree(a->password);
+ xfree(a->login);
+ xfree(a->host);
+ xfree(a);
+ a = n;
+ }
+}
#ifdef STANDALONE
#include <sys/types.h>
@@ -399,6 +411,8 @@ int main (int argc, char **argv)
a = a->next;
}
+ free_netrc(head);
+
exit (0);
}
#endif /* STANDALONE */
diff --git a/netrc.h b/netrc.h
index 0309ba6d..c69316a8 100644
--- a/netrc.h
+++ b/netrc.h
@@ -46,6 +46,9 @@ netrc_entry *parse_netrc __P((char *file));
/* Return the netrc entry from LIST corresponding to HOST. NULL is
returned if no such entry exists. */
netrc_entry *search_netrc __P((netrc_entry *list, char *host, char *account));
+
+/* Free the netrc list structure */
+void free_netrc __P((netrc_entry *list));
__END_DECLS
#endif /* _NETRC_H_ */