if reply == NULL, the call `free(reply)` is a no-op, so we can have a
single check instead of two.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>