mod_http: Use hostname from the correct context (thanks gryffus)
[prosody.git] / util-src / pposix.c
index 7f64038beb3bd07bd353396ee47de4502e1db0b8..4fb1fb56b5346f062d9310b70a8788c177320a09 100644 (file)
@@ -666,6 +666,8 @@ int lc_fallocate(lua_State* L)
 {
        off_t offset, len;
        FILE *f = *(FILE**) luaL_checkudata(L, 1, LUA_FILEHANDLE);
+       if (f == NULL)
+               luaL_error(L, "attempt to use a closed file");
 
        offset = luaL_checkinteger(L, 2);
        len = luaL_checkinteger(L, 3);