Fixed infinite loop in config_ChainDuplicate.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 31 May 2009 19:52:35 +0000 (21:52 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 31 May 2009 19:53:02 +0000 (21:53 +0200)
src/config/chain.c

index 88ad283..13661e5 100644 (file)
@@ -416,7 +416,8 @@ config_chain_t *config_ChainDuplicate( const config_chain_t *p_src )
 {
     config_chain_t *p_dst = NULL;
     config_chain_t **pp_last = &p_dst;
-    while( p_src )
+
+    for( ; p_src != NULL; p_src = p_src->p_next )
     {
         config_chain_t *p = malloc( sizeof(*p) );
         if( !p )