main.c: Fix use-after-free on failed search_fn
When search_fn fails, it must free `r` before `results`, as the former is assigned based on the latter - otherwise, it would lead to undefined behaviour. So far, only memory allocation errors would make search_fn to fail.
This commit is contained in:
parent
74b7f7a902
commit
960a35a02f