summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-01-31 22:38:25 -0800
committerVinson Lee <[email protected]>2010-01-31 22:38:25 -0800
commit2de590eacdebb2e34d451807d10fad4c52e2a5a7 (patch)
tree563abcc53b06a36fedff366319d65388e7394502 /src
parent0df64f4bac5d2cb3c58adecdd5f447a38682fa4b (diff)
r300g: Fix memory leak on memory allocation failure.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_screen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index fa8ed581dae..4cef9a028af 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -375,8 +375,11 @@ struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys)
struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen);
struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities);
- if (!r300screen || !caps)
+ if (!r300screen || !caps) {
+ FREE(r300screen);
+ FREE(caps);
return NULL;
+ }
caps->pci_id = radeon_winsys->pci_id;
caps->num_frag_pipes = radeon_winsys->gb_pipes;