[MPlayer-cvslog] CVS: main/libmpdemux dvbin.c,1.20,1.21

Nico Sabbi CVS syncmail at mplayerhq.hu
Sat May 13 11:08:30 CEST 2006


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv5199

Modified Files:
	dvbin.c 
Log Message:
prevent memleak

Index: dvbin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvbin.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- dvbin.c	13 May 2006 09:01:18 -0000	1.20
+++ dvbin.c	13 May 2006 09:08:28 -0000	1.21
@@ -779,7 +779,7 @@
 	char filename[30], *conf_file, *name;
 	dvb_channels_list *list;
 	dvb_card_config_t *cards = NULL;
-	dvb_config_t *conf = NULL;
+	dvb_config_t *conf = NULL, *tmp;
 	
 	if(dvb_config != NULL)
 		return dvb_config;
@@ -833,13 +833,14 @@
 			continue;
 		
 		size = sizeof(dvb_card_config_t) * (conf->count + 1);
-		cards = realloc(conf->cards, size);
+		tmp = realloc(conf->cards, size);
 
-		if(cards == NULL)
+		if(tmp == NULL)
 	{
 			fprintf(stderr, "DVB_CONFIG, can't realloc %d bytes, skipping\n", size);
 			continue;
 	}
+		cards = tmp;
 
 		name = (char*) malloc(20);
 		if(name==NULL)




More information about the MPlayer-cvslog mailing list