aboutsummaryrefslogtreecommitdiffstats
path: root/netrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'netrc.c')
-rw-r--r--netrc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/netrc.c b/netrc.c
index 6c68d2c0..ea422edf 100644
--- a/netrc.c
+++ b/netrc.c
@@ -314,8 +314,10 @@ void
free_netrc(netrc_entry *a) {
while(a) {
netrc_entry *n = a->next;
- memset(a->password, 0x55, strlen(a->password));
- xfree(a->password);
+ if (a->password != NULL) {
+ memset(a->password, 0x55, strlen(a->password));
+ free(a->password);
+ }
xfree(a->login);
xfree(a->host);
xfree(a);