Fix memory leak in `?type=...` feature
Passing `?type=foo/bar` in the query string makes Webdis return the response with a `Content-Type: foo/bar` header (this is useful to serve files from Webdis, e.g. web page or their dependencies such as CSS, images, etc). I discovered with Valgrind that the *value* of this query string parameter was leaked and never freed, which would likely not cause a huge issue but would still gradually grow the memory usage. There were 2 different functions taking care of this parameter, the first calling strdup(3) on it and the second *transferring* pointer ownership into it (meaning overwriting the just-strdup'd value). This is now fixed, Webdis no longer leaks this small string, and an allocation was avoided.master
parent
6556039e05
commit
66ef564b13
Loading…
Reference in New Issue