From ba3f6f3779ff12a80e61b4e95d8e70f666b6c4e0 Mon Sep 17 00:00:00 2001 From: rr- Date: Tue, 4 Oct 2016 00:20:07 +0200 Subject: vo_drm: fix tiny memory leak --- video/out/drm_common.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'video/out/drm_common.c') diff --git a/video/out/drm_common.c b/video/out/drm_common.c index 4e9f497c6c..8a4e017d28 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -190,13 +190,18 @@ bool kms_setup(struct kms *kms, const char *device_path, int connector_id, int m } if (!setup_connector(kms, res, connector_id)) - return false; + goto err; if (!setup_crtc(kms, res)) - return false; + goto err; if (!setup_mode(kms, mode_id)) - return false; + goto err; + drmModeFreeResources(res); return true; + +err: + drmModeFreeResources(res); + return false; } void kms_destroy(struct kms *kms) -- cgit v1.2.3