iris: Free query on error path
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 11 Aug 2019 14:46:03 +0000 (07:46 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 11 Aug 2019 21:04:31 +0000 (14:04 -0700)
CID: 1452276

src/gallium/drivers/iris/iris_query.c

index c5ebf6b59bd9a74e0062117733d07569e0f79d08..139d9521a66f413e109defb419e4b83054ee32ae 100644 (file)
@@ -462,8 +462,10 @@ iris_create_batch_query(struct pipe_context *ctx,
    q->type = PIPE_QUERY_DRIVER_SPECIFIC;
    q->index = -1;
    q->monitor = iris_create_monitor_object(ice, num_queries, query_types);
-   if (unlikely(!q->monitor))
+   if (unlikely(!q->monitor)) {
+      free(q);
       return NULL;
+   }
 
    return (struct pipe_query *) q;
 }