[MPlayer-dev-eng] [PATCH] Returned without freeing storage "cddb_info"

Guillaume POIRIER poirierg at gmail.com
Sun Mar 12 15:24:25 CET 2006


Hi,

The attached patch addresses the following resource leak detected by
Covertity's checker:

CID: 154
Checker: RESOURCE_LEAK (help)
File: main/libmpdemux/cdda.c
Function: open_cdda
Description: Returned without freeing storage "cddb_info"

Do you think it's okay?

Guillaume
--
Reinventing the wheel certainly is annoying, but as long as all other
wheels are square...

Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/cdda.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
retrieving revision 1.21
diff -u -r1.21 cdda.c
--- libmpdemux/cdda.c	18 Nov 2005 14:39:18 -0000	1.21
+++ libmpdemux/cdda.c	12 Mar 2006 14:12:39 -0000
@@ -151,6 +151,7 @@
   if(!cdd) {
     mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_MPDEMUX_CDDA_CantOpenCDDADevice);
     m_struct_free(&stream_opts,opts);
+    free(cddb_info);
     return STREAM_ERROR;
   }
 
@@ -167,6 +168,7 @@
     mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_MPDEMUX_CDDA_CantOpenDisc);
     cdda_close(cdd);
     m_struct_free(&stream_opts,opts);
+    free(cddb_info);
     return STREAM_ERROR;
   }
 



More information about the MPlayer-dev-eng mailing list