1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 21:59:02 +00:00

Use new[] and delete[] instead of safe_zalloc for C++ objects

Discussion: http://seclists.org/nmap-dev/2013/q4/221
This commit is contained in:
dmiller
2013-12-02 12:40:18 +00:00
parent 0dafd86d22
commit 655e2283f8

View File

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