[MPlayer-dev-eng] [PATCH] Fix memleak in stream_dvb.c

Andrew Calkin andrew.calkin at gmail.com
Wed Dec 12 03:41:41 CET 2007


Patch does $subj. get_path() in dvb_get_config() returns a malloc'd string 
which is never free'd. Attached patch should address this.

//Andrew
-------------- next part --------------
--- MPlayer/stream/stream_dvb.c	2007-12-12 11:33:30.000000000 +0900
+++ MPlayer/stream/stream_dvb.c	2007-12-12 11:31:27.000000000 +0900
@@ -796,9 +796,15 @@
 		}
 		
 		if((access(conf_file, F_OK | R_OK) != 0))
+		{
+			if (conf_file)
+				free(conf_file);
 			conf_file = get_path("channels.conf");
+		}
 
 		list = dvb_get_channels(conf_file, type);
+		if (conf_file)
+			free(conf_file);
 		if(list == NULL)
 			continue;
 		


More information about the MPlayer-dev-eng mailing list