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; }