loader/dri3: simplify check for reply

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>
This commit is contained in:
Konstantin Kharlamov 2022-08-10 01:18:16 +03:00 committed by Marge Bot
parent 861167f41d
commit f572961d69

View file

@ -1239,10 +1239,8 @@ loader_dri3_open(xcb_connection_t *conn,
provider);
reply = xcb_dri3_open_reply(conn, cookie, NULL);
if (!reply)
return -1;
if (reply->nfd != 1) {
if (!reply || reply->nfd != 1) {
free(reply);
return -1;
}