summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Engestrom <eric.engestrom@intel.com>2019-08-09 23:41:53 +0100
committerEric Engestrom <eric.engestrom@intel.com>2019-08-10 12:14:56 +0100
commitd7eb40962bbf62b561cd51be94257786b2d2bbcc (patch)
tree4ada2014f194459fbd8a9d2aed1a3a6174b029ec /src/mesa
parent1c82fa0a92538e7673a6ea4bb6088c39059b3390 (diff)
downloadmesa-d7eb40962bbf62b561cd51be94257786b2d2bbcc.tar.gz
i965: fix mem leak in error path
Fixes: 8ae6667992ccca41d088 ("intel/perf: move query_object into perf") Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Diffstat (limited to 'src/mesa')
-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;