[MPlayer-dev-eng] [Patch] m_config.c memroy free fix (resend)

Wei Jiang jiangw98 at yahoo.com
Sat Oct 23 22:42:32 CEST 2004


Here is the resend file as requested
Wei jiang


diff -u -r1.10 m_config.c
--- m_config.c	20 Oct 2004 01:32:56 -0000	1.10
+++ m_config.c	23 Oct 2004 08:49:46 -0000
@@ -32,7 +32,10 @@
 #endif
   
   while(i) {
-    sl = i->slots;
+    if (i->flags & M_CFG_OPT_ALIAS)
+    	sl = NULL;
+    else
+     	sl = i->slots;
     while(sl) {
       m_option_free(i->opt,sl->data);
       st = sl->prev;
@@ -43,7 +46,7 @@
       free(i->name);
     ct = i->next;
     free(i);
-    ct = i;
+    i = ct;
   }
   free(config);  
 }
@@ -147,6 +150,7 @@
 
   // Option with childs -> add them
   if(arg->type->flags & M_OPT_TYPE_HAS_CHILD) {
+    co->slots = NULL;
     m_option_t *ol = arg->p;
     int i;
     for(i = 0 ; ol[i].name != NULL ; i++)
@@ -174,6 +178,7 @@
       m_option_set(arg,arg->p,sl->data);
     }
     sl->lvl = 0;
+    sl->prev = NULL;
     co->slots = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
     co->slots->prev = sl;
     co->slots->lvl = config->lvl;



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 




More information about the MPlayer-dev-eng mailing list