aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-12-21 00:58:47 (GMT)
committerDevin Heitmueller <dheitmueller@kernellabs.com>2009-12-21 00:58:47 (GMT)
commitaf27137adc35f92cb11288642afa1a13e2089b81 (patch)
treee56da363c5a0568b43ff690715cbeba6c5dd1f64
parent19fc0ce79ffa26733ab0440a72d0a354f1ca99d3 (diff)
djh - Make sure we cleanup the memory properly for the vbi data buffer.
-rw-r--r--src/vbidata.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vbidata.c b/src/vbidata.c
index 0a67d22..5886655 100644
--- a/src/vbidata.c
+++ b/src/vbidata.c
@@ -978,6 +978,7 @@ vbidata_t *vbidata_new( const char *filename, vbiscreen_t *vs, int verbose )
vbi->open = 0;
vbi->usexds = 0;
+ vbi->buf = NULL;
vbi->vs = vs;
vbi->verbose = verbose;
@@ -1039,6 +1040,10 @@ static void vbidata_open_device( vbidata_t *vbi )
static void vbidata_close_device( vbidata_t *vbi )
{
close( vbi->fd );
+ if ( vbi->buf != NULL ) {
+ free(vbi->buf);
+ vbi->buf = NULL;
+ }
vbi->open = 0;
}

Privacy Policy