summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2011-11-12 22:30:48 +0100
committerFrank Schmirler <vdr@schmirler.de>2011-11-12 22:31:39 +0100
commit30674fb6c83fea4f20bd54b70ed23f4defbb9dbd (patch)
tree84d3e8207afd3e2c57f60135a442c681a45a1caa
parent8850e63da52f7eefbd656447becc2956b17ec614 (diff)
downloadvdr-plugin-streamdev-30674fb6c83fea4f20bd54b70ed23f4defbb9dbd.tar.gz
vdr-plugin-streamdev-30674fb6c83fea4f20bd54b70ed23f4defbb9dbd.tar.bz2
fixed memory leak in libdvbmpeg read_pes (fixes #769)
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY1
-rw-r--r--libdvbmpeg/ctools.c5
3 files changed, 6 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 6674b70..507710b 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -196,3 +196,4 @@ Lubo¨ Dole¸el
Ville Skyttä
for updating the outdated COPYING file and FSF address
for restricting VTP command RENR to liemikuutio patch < 1.32
+ for fixing memory and filedescriptor leaks in libdvbmpeg
diff --git a/HISTORY b/HISTORY
index 481abea..b09502d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History
---------------------------------------
+- fixed memory leak in libdvbmpeg read_pes (thanks to Ville Skyttä)
- dropped several unused functions in libdvbmpeg
- restricted VTP command RENR to liemikuutio patch < 1.32. Build fails with
newer versions of this patch (thanks to Ville Skyttä)
diff --git a/libdvbmpeg/ctools.c b/libdvbmpeg/ctools.c
index 113c973..185ba45 100644
--- a/libdvbmpeg/ctools.c
+++ b/libdvbmpeg/ctools.c
@@ -596,7 +596,10 @@ int read_pes(int f, pes_packet *p){
if (p->length >0){
buf = (uint8_t *) malloc(p->length);
- if((neof = save_read(f,buf,p->length))< p->length) return -1;
+ if((neof = save_read(f,buf,p->length))< p->length){
+ free(buf);
+ return -1;
+ }
cread_pes((char *)buf,p);
free(buf);
} else return 0;