diff --git a/NmapOps.cc b/NmapOps.cc index ef273bcdc..15f29dbd1 100644 --- a/NmapOps.cc +++ b/NmapOps.cc @@ -462,9 +462,11 @@ void NmapOps::ValidateOptions() { if(ipoptions && osscan) error("WARNING: Ip options are NOT used while OS scanning!"); +#ifndef NOLUA /* Make sure nmap.registry.args is available (even if it's empty) */ if (!scriptargs) scriptargs = strdup(""); +#endif } void NmapOps::setMaxOSTries(int mot) { diff --git a/nmap.cc b/nmap.cc index 94b5291e7..98fb9717b 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1631,7 +1631,11 @@ int nmap_main(int argc, char *argv[]) { if (currenths->flags & HOST_UP && !o.listscan) o.numhosts_up++; - if ((o.pingscan && !o.traceroute && !o.script) || o.listscan) { + if ((o.pingscan && !o.traceroute +#ifndef NOLUA + && !o.script +#endif + ) || o.listscan) { /* We're done with the hosts */ log_write(LOG_XML, ""); write_host_status(currenths, o.resolve_all); @@ -1909,7 +1913,9 @@ void nmap_free_mem() { if (o.dns_servers) free(o.dns_servers); if (o.extra_payload) free(o.extra_payload); if (o.ipoptions) free(o.ipoptions); +#ifndef NOLUA free(o.scriptargs); +#endif } /* Reads in a (normal or machine format) Nmap log file and gathers enough diff --git a/output.cc b/output.cc index a9342beb7..cf142dd88 100644 --- a/output.cc +++ b/output.cc @@ -836,7 +836,7 @@ log_write(LOG_PLAIN, "%d service%s unrecognized despite returning data. If you k } #ifndef NOLUA -char* formatScriptOutput(ScriptResult sr) { +static char* formatScriptOutput(ScriptResult sr) { std::string result = std::string(), output = sr.get_output(); string::size_type pos; char *c_result, *c_output = new char[output.length()+1]; diff --git a/output.h b/output.h index 7236b79eb..2452e0004 100644 --- a/output.h +++ b/output.h @@ -196,7 +196,6 @@ void printosscanoutput(Target *currenths); void printserviceinfooutput(Target *currenths); void printhostscriptresults(Target *currenths); -char* formatScriptOutput(ScriptResult sr); /* Print a detailed list of Nmap interfaces and routes to normal/skiddy/stdout output */