From bae49de0af26c2447da0cf16cf0d5feb6a8dca43 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 30 Apr 2020 13:17:53 +0200 Subject: [PATCH] Clean the new kb when the scan was stopped and the host has not been started. --- CHANGELOG.md | 1 + src/attack.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c02db3745..44e350663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Don't detect MongoDB as a HTTP service. [#447](https://github.com/greenbone/openvas/pull/447) - Set status finished and send a message if the port list is invalid. [#453](https://github.com/greenbone/openvas/pull/453) - Fix format-truncation warning in GCC 8.2 and later. [#461](https://github.com/greenbone/openvas/pull/461) +- Clean the new kb when the scan was stopped and the host has not been started. [#494](https://github.com/greenbone/openvas/pull/494) [Unreleased]: https://github.com/greenbone/openvas/compare/openvas-7.0...master diff --git a/src/attack.c b/src/attack.c index f8e944865..4f5250dfd 100644 --- a/src/attack.c +++ b/src/attack.c @@ -1300,12 +1300,14 @@ attack_network (struct scan_globals *globals, kb_t *network_kb) host_str = gvm_host_value_str (host); if (hosts_new (host_str, host_kb) < 0) { + kb_delete (host_kb); g_free (host_str); goto scan_stop; } if (scan_is_stopped ()) { + kb_delete (host_kb); g_free (host_str); continue; }