In case of success the current implementation returns the result
of $res->free(). Unfortunately free() doesn't return anything.
That causes sql_free_result() to return NULL, which eventually
evaluates to FALSE.
Make sure the return value is correct and
return TRUE in case of success.