From 4cc441248121493350eb50277d2815ec31e9ea59 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 30 Jun 2018 11:04:17 +0900 Subject: wlr_renderer_destroy: fix renderer NULL check renderer is checked for NULL, but was dereferenced before that. Found through static analysis --- render/wlr_renderer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'render/wlr_renderer.c') diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 98c91132..00f1e411 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -25,9 +25,12 @@ void wlr_renderer_init(struct wlr_renderer *renderer, } void wlr_renderer_destroy(struct wlr_renderer *r) { + if (!r) { + return; + } wlr_signal_emit_safe(&r->events.destroy, r); - if (r && r->impl && r->impl->destroy) { + if (r->impl && r->impl->destroy) { r->impl->destroy(r); } else { free(r); -- cgit v1.2.3