From 86077ed05fcd9f3bc7cf27a444d08d9cc13b3280 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 5 Jun 2012 21:09:01 +0000 Subject: [PATCH] Don't strdup (and fail to free) pattern passed to pcre_compile. http://seclists.org/nmap-dev/2012/q2/627 --- nse_pcrelib.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nse_pcrelib.cc b/nse_pcrelib.cc index 2b37a4a88..80230a8f0 100644 --- a/nse_pcrelib.cc +++ b/nse_pcrelib.cc @@ -109,7 +109,7 @@ static int Lpcre_comp(lua_State *L) const char *error; int erroffset; pcre2 *ud; - char *pattern = strdup(luaL_checkstring(L, 1)); + const char *pattern = luaL_checkstring(L, 1); int cflags = luaL_optint(L, 2, 0); const unsigned char *tables = NULL;