From b39377d66ac04363f3c47ba5870c5ef71a95f5b8 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 29 Apr 2019 18:10:52 +0900 Subject: [PATCH] xf86drm: Fix possible memory leak with drmModeGetPropertyPtr() In drmModeGetPropertyPtr(), from upper error path, it calls free but with just next error path, it does not call. Fix the possible memory leak. Signed-off-by: Seung-Woo Kim Reviewed-by: Eric Engestrom --- xf86drmMode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index c878d9ea..207d7be9 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -650,7 +650,7 @@ drm_public drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id) } if (!(r = drmMalloc(sizeof(*r)))) - return NULL; + goto err_allocs; r->prop_id = prop.prop_id; r->count_values = prop.count_values;