From 655e2283f8924c42fcecdd075c458e0d655b7c84 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 2 Dec 2013 12:40:18 +0000 Subject: [PATCH] Use new[] and delete[] instead of safe_zalloc for C++ objects Discussion: http://seclists.org/nmap-dev/2013/q4/221 --- osscan2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osscan2.cc b/osscan2.cc index eed70db70..eb3b76276 100644 --- a/osscan2.cc +++ b/osscan2.cc @@ -3381,7 +3381,7 @@ HostOsScanInfo::HostOsScanInfo(Target *t, OsScanInfo *OsSI) { OSI = OsSI; FPs = (FingerPrint **) safe_zalloc(o.maxOSTries() * sizeof(FingerPrint *)); - FP_matches = (FingerPrintResultsIPv4 *) safe_zalloc(o.maxOSTries() * sizeof(FingerPrintResultsIPv4)); + FP_matches = new FingerPrintResultsIPv4[o.maxOSTries()]; timedOut = false; isCompleted = false; @@ -3398,7 +3398,7 @@ HostOsScanInfo::HostOsScanInfo(Target *t, OsScanInfo *OsSI) { HostOsScanInfo::~HostOsScanInfo() { delete hss; free(FPs); - free(FP_matches); + delete[] FP_matches; }