We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a82bb36 + 70f4c58 commit bc5e8b2Copy full SHA for bc5e8b2
src/lua/ftl_lua.c
@@ -279,6 +279,7 @@ static int pihole_format_path(lua_State *L) {
279
}
280
281
// Strip leading webhome from page_copy (if it exists)
282
+ char *page_copy_start = page_copy;
283
if (config.webserver.paths.webhome.v.s != NULL)
284
{
285
const size_t webhome_len = strlen(config.webserver.paths.webhome.v.s);
@@ -302,8 +303,8 @@ static int pihole_format_path(lua_State *L) {
302
303
lua_pushstring(L, page_copy);
304
305
- // Free allocated memory
306
- free(page_copy);
+ // Free originally allocated memory (page_copy may have been modified)
307
+ free(page_copy_start);
308
309
return 1; // number of results
310
0 commit comments