1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Reuse strings for IPv6 OS detection probe IDs

This commit is contained in:
dmiller
2022-09-13 16:10:04 +00:00
parent 478e156b04
commit f44f255da3
2 changed files with 2 additions and 6 deletions

View File

@@ -2559,8 +2559,6 @@ FPProbe::FPProbe() {
FPProbe::~FPProbe() { FPProbe::~FPProbe() {
if (this->probe_id != NULL)
free(this->probe_id);
} }
@@ -2570,8 +2568,6 @@ void FPProbe::reset() {
this->times_replied = 0; this->times_replied = 0;
this->failed = false; this->failed = false;
this->timed = false; this->timed = false;
if (this->probe_id != NULL)
free(this->probe_id);
this->probe_id = NULL; this->probe_id = NULL;
/* Also call FPPacket::__reset() to free any existing packet information */ /* Also call FPPacket::__reset() to free any existing packet information */
@@ -2601,7 +2597,7 @@ bool FPProbe::isResponse(PacketElement *rcvd) {
* of the supplied string, so you can safely change its contents without * of the supplied string, so you can safely change its contents without
* affecting the object's state. */ * affecting the object's state. */
int FPProbe::setProbeID(const char *id) { int FPProbe::setProbeID(const char *id) {
this->probe_id = strdup(id); this->probe_id = string_pool_insert(id);
return OP_SUCCESS; return OP_SUCCESS;
} }

View File

@@ -265,7 +265,7 @@ class FPPacket {
class FPProbe : public FPPacket { class FPProbe : public FPPacket {
private: private:
char *probe_id; const char *probe_id;
int probe_no; int probe_no;
int retransmissions; int retransmissions;
int times_replied; int times_replied;