From 7f1654e3ac4c5bf793cf88991d4e85d42e8868fa Mon Sep 17 00:00:00 2001 From: kris Date: Fri, 16 Nov 2007 02:20:09 +0000 Subject: [PATCH] Adding a couple free()s when having an early return in l_port_accessor() in nse_nmaplib.cc. Coverity (CID 32) found function_name, I added target_ip. --- nse_nmaplib.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nse_nmaplib.cc b/nse_nmaplib.cc index 1d84b99a6..4c645ddff 100644 --- a/nse_nmaplib.cc +++ b/nse_nmaplib.cc @@ -307,8 +307,11 @@ static int l_port_accessor(lua_State* l) { } // if the port wasn't scanned we return nil - if(port == NULL) + if(port == NULL) { + free(target_ip); + free(function_name); return 0; + } if(strcmp(function_name, "set_port_state") == MATCH) retvalues = l_set_port_state(l, target, port);