[mod_magnet] fix regression in lighty.stat (fixes
fix regression in mod_magnet lighty.stat introduced in lighttpd 1.4.49
in commit commit:b1df38ab
x-ref:
"lighty.stat failure"
@@ -334,14 +334,16 @@ static int magnet_stat(lua_State *L) {
handler_t res;
res = stat_cache_get_entry(srv, con, sb, &sce);
- stat_cache_content_type_get(srv, con, sb, sce);
- buffer_free(sb);
if (HANDLER_GO_ON != res) {
+ buffer_free(sb);
lua_pushnil(L);
return 1;
}
+ stat_cache_content_type_get(srv, con, sb, sce);
+ buffer_free(sb);
+
lua_newtable(L); // return value
lua_pushboolean(L, S_ISREG(sce->st.st_mode));
