nv50/ir: Free target if we failed to create a program

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Pierre Moreau
2017-05-06 23:47:21 +02:00
committed by Ilia Mirkin
parent b490ca9a38
commit dd7ab4dcb4

View File

@@ -1224,8 +1224,10 @@ nv50_ir_generate_code(struct nv50_ir_prog_info *info)
return -1; return -1;
nv50_ir::Program *prog = new nv50_ir::Program(type, targ); nv50_ir::Program *prog = new nv50_ir::Program(type, targ);
if (!prog) if (!prog) {
nv50_ir::Target::destroy(targ);
return -1; return -1;
}
prog->driver = info; prog->driver = info;
prog->dbgFlags = info->dbgFlags; prog->dbgFlags = info->dbgFlags;
prog->optLevel = info->optLevel; prog->optLevel = info->optLevel;