Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] fixing memory leak in pesplot



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Running pesplot on a VDR recording, I noticed that my computer
ran out of memory quite fast. So I suggest the included patch.

Greetings, Stephan

Index: cpptools.hh
===================================================================
RCS file: /cvs/linuxtv/DVB/apps/mpegtools/cpptools.hh,v
retrieving revision 1.6
diff -u -p -u -r1.6 cpptools.hh
- --- cpptools.hh 27 Jun 2001 12:21:47 -0000      1.6
+++ cpptools.hh 6 Jul 2002 11:11:12 -0000
@@ -78,12 +78,15 @@ public:

        inline void setlength(){
                setlength_pes(&p);
- -               if (p.length)
+               if (p.length) {
+                       delete [] p.pes_pckt_data;
                        p.pes_pckt_data = new u8[p.length];
+               }
        }

        inline void Nlength(){
                nlength_pes(&p);
+               delete [] p.pes_pckt_data;
                p.pes_pckt_data = new u8[p.length];
        }

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9JtM9wFSBhlBjoJYRAhIaAKCyiEs22XbvHiykyyg1XJ312zc96gCgv3Bo
2AQiiziZNrR4DV2lqV9kpxM=
=AA+A
-----END PGP SIGNATURE-----



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index