diff --git a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp index abea496023f..3d9e7aa6a74 100644 --- a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp +++ b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp @@ -312,8 +312,10 @@ d3d12_get_gfx_pipeline_state(struct d3d12_context *ctx) data->key = ctx->gfx_pipeline_state; data->pso = create_gfx_pipeline_state(ctx); - if (!data->pso) + if (!data->pso) { + FREE(data); return NULL; + } entry = _mesa_hash_table_insert_pre_hashed(ctx->pso_cache, hash, &data->key, data); assert(entry);