[mythtv] File descriptor leak in mythmusic?

Scott Elliott selliott at insight.rr.com
Wed Feb 26 16:42:19 EST 2003


I've figured it out.  cd_finish() isn't being called in a couple of
places in cddecoder.cpp.  I've attached a patch to fix it.

-- 
Scott Elliott <selliott at insight.rr.com>
-------------- next part --------------
--- mythmusic/mythmusic/cddecoder.cpp	2003-02-05 14:47:54.000000000 -0500
+++ new/mythmusic/cddecoder.cpp	2003-02-26 10:26:16.000000000 -0500
@@ -356,6 +356,7 @@
 
     if (ret < 0)
     {
+        cd_finish(cd);
         cout << "bad lookup :(\n";
         return NULL;
     }
@@ -385,6 +386,7 @@
     Metadata *retdata = new Metadata(filename, artist, album, title, genre,
                                      year, tracknum, length);
 
+    cd_finish(cd);
     return retdata;
 }    
 
@@ -422,6 +424,7 @@
 
     if (ret < 0)
     {
+        cd_finish(cd);
         cout << "bad lookup :(\n";
         return;
     }
@@ -439,6 +442,7 @@
     }
 
     cddb_write_data(cd, &discdata);
+    cd_finish(cd);
 }
 
 bool CdDecoderFactory::supports(const QString &source) const


More information about the mythtv-dev mailing list