hugsy/proxenet

proxenet_xfree of NULL pointer

thorgul opened this issue · 1 comments

In proxenet_process_http_request

the following lines can cause a free of a NULL pointer :
req.data = proxenet_apply_plugins(&req);
[...]
proxenet_xfree(req.data);

A simple fix would be to do the following:
if (req.data) {
proxenet_xfree(req.data);
}

This is the expected behavior: if a pointer is NULL when invoking proxenet_xfree(), then it will crash. However, the bug does not come from xfree but somewhere else, and since it should not happen, we want the program to crash (this is actually the expected behavior).