[mod_magnet] fix memory leak

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2943 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Stefan Bühler 2014-02-14 21:06:10 +00:00
parent b461e031f5
commit b239e7734a
2 changed files with 3 additions and 0 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ NEWS
* [mod_rrdtool] fix invalid read (string not null terminated)
* [mod_dirlisting] fix memory leak if pcre fails
* [mod_fastcgi,mod_scgi] fix resource leaks on spawning backends
* [mod_magnet] fix memory leak
- 1.4.34
* [mod_auth] explicitly link ssl for SHA1 (fixes #2517)

View File

@ -786,10 +786,12 @@ static int magnet_attach_content(server *srv, connection *con, plugin_data *p, l
}
if (off < 0) {
buffer_free(fn);
return luaL_error(L, "offset for '%s' is negative", fn->ptr);
}
if (len < off) {
buffer_free(fn);
return luaL_error(L, "offset > length for '%s'", fn->ptr);
}