mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 20:51:30 +00:00
Reuse strings for IPv6 OS detection probe IDs
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user