From: Eric Engestrom Date: Fri, 9 Aug 2019 22:41:53 +0000 (+0100) Subject: i965: fix mem leak in error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7eb40962bbf62b561cd51be94257786b2d2bbcc;p=mesa.git i965: fix mem leak in error path Fixes: 8ae6667992ccca41d088 ("intel/perf: move query_object into perf") Signed-off-by: Eric Engestrom Reviewed-by: Mark Janes --- diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index f7016e4dd15..16e467442bc 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -350,8 +350,10 @@ brw_new_perf_query_object(struct gl_context *ctx, unsigned query_index) return NULL; struct brw_perf_query_object *brw_query = calloc(1, sizeof(struct brw_perf_query_object)); - if (unlikely(!brw_query)) + if (unlikely(!brw_query)) { + gen_perf_delete_query(perf_ctx, obj); return NULL; + } brw_query->query = obj; return &brw_query->base;