wlr_renderer_destroy: fix renderer NULL check
renderer is checked for NULL, but was dereferenced before that. Found through static analysis
This commit is contained in:
parent
b3313b7f39
commit
4cc4412481
|
@ -25,9 +25,12 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlr_renderer_destroy(struct wlr_renderer *r) {
|
void wlr_renderer_destroy(struct wlr_renderer *r) {
|
||||||
|
if (!r) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
wlr_signal_emit_safe(&r->events.destroy, r);
|
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);
|
r->impl->destroy(r);
|
||||||
} else {
|
} else {
|
||||||
free(r);
|
free(r);
|
||||||
|
|
Loading…
Reference in New Issue