summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-05-01 11:23:36 +0000
committerjstebbins <[email protected]>2012-05-01 11:23:36 +0000
commitdf3daf7cdd85794ef3d7f0eff181eb3b323a489f (patch)
treebb7e5295a613949f3b556d7baf5a43b387b551f6 /libhb
parent2e8be70b9910c62d8d8cb693f8c58485efbf4e97 (diff)
merge assorted fixes provided by Rogerio Brito
Pretty much all resource cleanup issues on error condition handling. Thanks Rogerio! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4620 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/dvd.c2
-rw-r--r--libhb/muxmkv.c6
-rw-r--r--libhb/ports.c1
3 files changed, 7 insertions, 2 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index bd167e775..5dbe85072 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -146,7 +146,7 @@ hb_dvd_t * hb_dvdread_init( char * path )
fail:
if( d->vmg ) ifoClose( d->vmg );
if( d->reader ) DVDClose( d->reader );
- free( d );
+ free( e );
return NULL;
}
diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c
index 1140bc5b0..227159579 100644
--- a/libhb/muxmkv.c
+++ b/libhb/muxmkv.c
@@ -77,6 +77,7 @@ static int MKVInit( hb_mux_object_t * m )
hb_error( "Could not create output file, Disk Full?" );
job->mux_data = NULL;
*job->die = 1;
+ free(track);
return 0;
}
@@ -94,8 +95,10 @@ static int MKVInit( hb_mux_object_t * m )
/* Taken from x264 muxers.c */
avcC_len = 5 + 1 + 2 + job->config.h264.sps_length + 1 + 2 + job->config.h264.pps_length;
avcC = malloc(avcC_len);
- if (avcC == NULL)
+ if (avcC == NULL) {
+ free(track);
return -1;
+ }
avcC[0] = 1;
avcC[1] = job->config.h264.sps[1]; /* AVCProfileIndication */
@@ -158,6 +161,7 @@ static int MKVInit( hb_mux_object_t * m )
default:
*job->die = 1;
hb_error("muxmkv: Unknown video codec: %x", job->vcodec);
+ free(track);
return 0;
}
diff --git a/libhb/ports.c b/libhb/ports.c
index 6ccbaede3..cec4efd96 100644
--- a/libhb/ports.c
+++ b/libhb/ports.c
@@ -693,6 +693,7 @@ hb_net_t * hb_net_open( char * address, int port )
if (iResult != 0)
{
hb_log("WSAStartup failed: %d", iResult);
+ free(n);
return NULL;
}
winsock_init = 1;