All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH] free nvs->pass_rec on error in nouveau_shader_pass2(), nouveau_shader_2.c
Date: Wed, 30 Jan 2008 00:56:27 +0100	[thread overview]
Message-ID: <479FBD2B.3020309@tiscali.nl> (raw)

in nouveau_shader_pass2()

210:    struct pass2_rec *rec;
...
215:    rec = calloc(1, sizeof(struct pass2_rec));
...
218:    nvs->pass_rec = rec;

untested, please check.
--
also free nvs->pass_rec on error

Signed-off-by: Roel Kluin <12o3l-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
---
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
index cd27dac..0bbcb8a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
@@ -229,6 +229,8 @@ nouveau_shader_pass2(nvsPtr nvs)
 			     ((nvsSubroutine*)nvs->program_tree)->insn_head)) {
 		free(nvs->program);
 		nvs->program = NULL;
+		free(nvs->pass_rec);
+		nvs->pass_rec = NULL;
 		return GL_FALSE;
 	}

             reply	other threads:[~2008-01-29 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 23:56 Roel Kluin [this message]
     [not found] ` <479FBD2B.3020309-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
2008-01-30  0:36   ` [PATCH] free nvs->pass_rec on error in nouveau_shader_pass2(), nouveau_shader_2.c Stephane Marchesin
     [not found]     ` <6a89f9d50801291636j32cb1e39j79c4a921b3c3a9d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-01-30 11:34       ` Roel Kluin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=479FBD2B.3020309@tiscali.nl \
    --to=12o3l-iwqwacnznjzz+pzb47itoq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.