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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user