[MPlayer-cvslog] r36650 - trunk/libmpcodecs/ad_realaud.c

reimar subversion at mplayerhq.hu
Sun Jan 19 23:24:45 CET 2014


Author: reimar
Date: Sun Jan 19 23:24:45 2014
New Revision: 36650

Log:
ad_realaud: Fix memory leak in error path.

Modified:
   trunk/libmpcodecs/ad_realaud.c

Modified: trunk/libmpcodecs/ad_realaud.c
==============================================================================
--- trunk/libmpcodecs/ad_realaud.c	Sun Jan 19 22:45:59 2014	(r36649)
+++ trunk/libmpcodecs/ad_realaud.c	Sun Jan 19 23:24:45 2014	(r36650)
@@ -313,12 +313,12 @@ static int preinit(sh_audio_t *sh){
       result = raOpenCodec2(&sh->context, path);
     } else
       result=raOpenCodec(&sh->context);
+    free(path); /* after this it isn't used anymore */
     if(result){
       mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);
       return 0;
     }
 //    printf("opencodec ok (result: %x)\n", result);
-  free(path); /* after this it isn't used anymore */
 
   sh->samplerate=sh->wf->nSamplesPerSec;
   sh->samplesize=sh->wf->wBitsPerSample/8;


More information about the MPlayer-cvslog mailing list