mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 05:01:29 +00:00
Don't bother allocating space for 'unknown' string.
This commit is contained in:
@@ -231,7 +231,15 @@ static int nmap_services_init() {
|
|||||||
|
|
||||||
struct service_node sn;
|
struct service_node sn;
|
||||||
|
|
||||||
|
if (strcmp(servicename, "unknown") == 0) {
|
||||||
|
// there are a ton (15K+) of ports in our db with this service name, and
|
||||||
|
// we already write "unknown" if this is NULL, so don't bother allocating
|
||||||
|
// space for it.
|
||||||
|
sn.s_name = NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
sn.s_name = cp_strdup(servicename);
|
sn.s_name = cp_strdup(servicename);
|
||||||
|
}
|
||||||
sn.s_port = portno;
|
sn.s_port = portno;
|
||||||
sn.s_proto = npe->p_name;
|
sn.s_proto = npe->p_name;
|
||||||
sn.ratio = ratio;
|
sn.ratio = ratio;
|
||||||
|
|||||||
Reference in New Issue
Block a user