summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-08-09 23:41:53 +0100
committerEric Engestrom <[email protected]>2019-08-10 12:14:56 +0100
commitd7eb40962bbf62b561cd51be94257786b2d2bbcc (patch)
tree4ada2014f194459fbd8a9d2aed1a3a6174b029ec /src/mesa/drivers
parent1c82fa0a92538e7673a6ea4bb6088c39059b3390 (diff)
i965: fix mem leak in error path
Fixes: 8ae6667992ccca41d088 ("intel/perf: move query_object into perf") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Mark Janes <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c4
1 files changed, 3 insertions, 1 deletions
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;