fix potential leak in r600_context_init
authorTim Wiederhake <twied@gmx.net>
Mon, 24 Jan 2011 15:59:16 +0000 (16:59 +0100)
committerAlex Deucher <alexdeucher@gmail.com>
Tue, 25 Jan 2011 19:18:19 +0000 (14:18 -0500)
src/gallium/winsys/r600/drm/r600_hw_context.c

index f10e2fda6f2b530f3038b45ae818e2301258746d..acbe22a950a681ea7cc30e97f8d00c501eb54a5d 100644 (file)
@@ -637,7 +637,8 @@ int r600_context_init(struct r600_context *ctx, struct radeon *radeon)
                ctx->range[i].end_offset = ((i + 1) << ctx->hash_shift) - 1;
                ctx->range[i].blocks = calloc(1 << ctx->hash_shift, sizeof(void*));
                if (ctx->range[i].blocks == NULL) {
-                       return -ENOMEM;
+                       r = -ENOMEM;
+                       goto out_err;
                }
        }