From 025dc8b68e812f4cdb0943baf8d43d3683651490 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 19 Jan 2006 03:28:09 +0000 Subject: Implement free_netrc(list). svn path=/branches/BRANCH_6-3/; revision=4659 --- netrc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'netrc.c') 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 @@ -399,6 +411,8 @@ int main (int argc, char **argv) a = a->next; } + free_netrc(head); + exit (0); } #endif /* STANDALONE */ -- cgit v1.2.3