changeset 35209:b7ec2526b402

Set pointers to NULL after free. For the pal_image one it would have been possible to leak the old pointer of the malloc for "image" failed.
author reimar
date Tue, 30 Oct 2012 18:53:58 +0000
parents 9e06c2e4844e
children 318c7824c50d
files sub/spudec.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sub/spudec.c	Tue Oct 30 18:37:37 2012 +0000
+++ b/sub/spudec.c	Tue Oct 30 18:53:58 2012 +0000
@@ -227,7 +227,9 @@
   if (this->image_size < this->stride * this->height) {
     if (this->image != NULL) {
       free(this->image);
+      this->image = NULL;
       free(this->pal_image);
+      this->pal_image = NULL;
       this->image_size = 0;
       this->pal_width = this->pal_height  = 0;
     }