From 042b54524766d725d5e2741ec471a772927622d3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 12 May 2009 09:32:51 +0000 Subject: [PATCH] clear the passed in struct when the entry has been removed to help prevent mistakes due to re-use --- src/knownhost.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/knownhost.c b/src/knownhost.c index bb30272..3bf034a 100644 --- a/src/knownhost.c +++ b/src/knownhost.c @@ -340,6 +340,9 @@ libssh2_knownhost_del(LIBSSH2_KNOWNHOSTS *hosts, /* free all resources */ free_host(hosts->session, node); + /* clear the struct now since this host entry has been removed! */ + memset(entry, 0, sizeof(struct libssh2_knownhost)); + return 0; }