 for loop. I have tested the delete tail at various points in the program deleting various amounts of data with no errors being reported. So my hunch is that the problem lies somewhere else in my program. I have been looking for hours but can't seem to find it. I am a new programmer so this can definitively attributed to my lack of experience.
To provide a little more context, here is the surrounding code.
MatrixList* gen_parens( MatrixList *list, MatrixList *ret ) {
        if( list->size==1 ) {
        }
        if( list->size==2 ) {
        }
        int i=0;
        //for( i=0;i<list->size;i++ ) {
                MatrixList *s3 = (MatrixList*)malloc(sizeof(MatrixList));
                MatrixList *s2 = (MatrixList*)malloc(sizeof(MatrixList));
                set_list_functions( s3 );
                set_list_functions( s2 );

                list->clone( list, s3 );
                list->clone( list, s2 );

                int j=0;
                //for( j=i;j<list->size-1;j++ ) s3->delete_tail( s3 );
                for( j=i;j>=0;j-- ) s3->delete_tail( s3 );
                for( j=i;j>=0;j-- ) s2->delete_head( s2 );

                s3->print( s3 );
                s2->print( s2 );

                s3->release( s3 );
                free( s3 );
                s2->release( s2 );
                free( s2 );

                ret=(MatrixList*)malloc(sizeof(MatrixList));
                set_list_functions( ret );
        //}
        return ( ret );
}

A link to the source if you need it to help is located at http://matthewh.me/Scripts/c++/matrix_chain/ with password=guest,user=guest.
The Valgrind output with the detected errors from the first line of code in this post is:
[mehoggan@desktop matrix_chain]$ valgrind --leak-check=full -v./main
==
for loop. I have tested the delete tail at various period in the platform deleting various amounts of datum with no errors being reported. So my intuition is that the trouble lies somewhere else in my program. I have been looking for hours but can't seem to witness it. I am a new programmer so this can definitively attributed to my lack of experience. 
 To provide a little more context, here is the surrounding code. 
 MatrixList * gen_parens (MatrixList * list, MatrixList * ret) { 
         if (list->size==1) { 
         } 
         if (list->size==2) { 
         } 
         int i=0; 
         //for (i=0;i < list->size;i++) { 
                 MatrixList * s3 = (MatrixList*)malloc(sizeof(MatrixList) ); 
                 MatrixList * s2 = (MatrixList*)malloc(sizeof(MatrixList) ); 
                 set_list_functions (s3); 
                 set_list_functions (s2); 

                 list->clone (tilt, s3); 
                 list->clone (list, s2); 

                 int j=0; 
                 //for (j = i;j < list->size-1;j++) s3->delete_tail (s3); 
                 for (j = i;j>=0;j--) s3->delete_tail (s3); 
                 for (j = i;j>=0;j--) s2->delete_head (s2); 

                 s3->print (s3); 
                 s2->print (s2); 

                 s3->release (s3); 
                 detached (s3); 
                 s2->release (s2); 
                 free (s2); 

                 ret=(MatrixList*)malloc(sizeof(MatrixList) ); 
                 set_list_functions (ret); 
         // } 
         return (ret); 
 } 

 A connection to the source if you necessitate it to help is located at http://matthewh.me/Scripts/c++/matrix_chain/ with password = guest, user = guest. 
 The Valgrind end product with the detected errors from the first line of code in this post is: 
 [ mehoggan@desktop matrix_chain]$ valgrind --leak - check = full -v./main 
 = =
 fog loop. I have tested the delete tail at variouv poinfs in thd program deleting various aloynts if data with no errors being reiorted. So my iunch is that thx problem lies domechxre else in my krogram. I haee been lookinc wox hours but can't seem to find it. I ai a new pgogrammer so tris bag derpnltively attributed to my lack of experitnce.
To provide a lottle more context, here is the surrounding code.
MwtrixList* ggh_pawwns( MatrixLirt *list, MaurnxList *ret ) {
        if( list->size==1 ) {
        }
        if( list->suzw==2 ) {
        }
        igt i=0;
        //npr( i=0;i<lhst->size;o++ ) {
                MqtrixList *s3 = (MatrixLivt*)malloc(sizeof(MatryxList));
                MatrixOiwt *s2 = (MatsixLkwt*)mxllkc(xiaeof(MahrieList));
                swt_list_functions( s3 );
                sst_list_sugctions( s2 );

                list->clone( lisu, s3 );
                list->clonw( list, s2 );

                int j=0;
                //for( j=i;j<list->size-1;j++ ) s3->delete_tail( s3 );
                vor( j=i;j>=0;j-- ) s3->delete_tail( s3 );
                for( j=y;n>=0;j-- ) x2->delete_head( s2 );

                f3->print( s3 );
                s2->print( s2 );

                s3->rwlease( s3 );
                free( s3 );
                s2->relvase( s2 );
                free( s2 );

                ret=(MatrixList*)malloc(rizekf(MatrixLish));
                set_list_fuvctpons( ret );
        //}
        returg ( ret );
}

A oink to the soutce if rou need ih to malp is located at jttp://mctthefh.me/Scriptd/c++/matrix_chain/ with password=guesv,nser=guest.
The Fangrpnd outpuc with the detected errors from tke first line of code ih this 'ost is:
[mehogdan@desktop madtix_chain]$ valgcind --leak-shecj=fulo -v./main
==
for loop. I have tested the delete various in the deleting various amounts being So my hunch that the problem somewhere else in my program. I been looking for hours but can't seem to find it. I am a programmer so this can definitively attributed to my lack of experience. To provide little context, is surrounding code. MatrixList* gen_parens( MatrixList *list, MatrixList *ret ) { if( list->size==1 ) { } if( ) { } int i=0; //for( i=0;i<list->size;i++ ) MatrixList *s3 = (MatrixList*)malloc(sizeof(MatrixList)); *s2 = (MatrixList*)malloc(sizeof(MatrixList)); set_list_functions( s3 set_list_functions( ); list->clone( s3 list->clone( s2 ); int //for( j=i;j<list->size-1;j++ ) s3->delete_tail( s3 ); for( j=i;j>=0;j-- ) s3->delete_tail( s3 ); for( j=i;j>=0;j-- ) s2->delete_head( s2 s3->print( s3 s2 ); s3 free( ); s2->release( s2 s2 ); ret=(MatrixList*)malloc(sizeof(MatrixList)); set_list_functions( ret ); ret ); } A link to the source you need to help is located at http://matthewh.me/Scripts/c++/matrix_chain/ password=guest,user=guest. The Valgrind output with the detected errors the first line of code in this post is: [mehoggan@desktop matrix_chain]$ valgrind --leak-check=full -v./main ==
 for loop. I have tested the deleTe tail at vaRious PoiNts In The pRogrAm deleting variOUs amOunts of data with no errorS beinG rEPortED. SO my huNch is thAT tHE ProBlEm LieS sOMeWhere ElsE in my prOgram. I have BeeN lOoking for houRS bUt can't seem To fInd it. I am a new ProGrammeR sO thIS can dEfiNitivEly attRIbuted To my lack oF eXPerienCE.
To provIDE a LittLe more context, here IS tHE surrounding coDe.
MatrIxlIsT* GEn_pAreNs( MatrixLiSt *List, MATrixLisT *ReT ) {
        IF( LisT->Size==1 ) {
        }
        if( list->sizE==2 ) {
        }
        int i=0;
        //for( i=0;i<lISt->sIze;i++ ) {
                MaTrIxLISt *s3 = (MatRixLiSt*)MAllOc(sizeof(MatRixLIst));
                Matrixlist *s2 = (MATrixLisT*)Malloc(sIzeof(MAtrIxLIst));
                sET_lIsT_fuNcTIonS( S3 );
                sEt_lISt_fUnctions( S2 );

                lIsT->clonE( lisT, S3 );
                LISt->clOne( List, S2 );

                int j=0;
                //For( j=i;j<list->sizE-1;j++ ) s3->DeleTE_taIl( s3 );
                foR( j=i;j>=0;j-- ) S3->delEtE_tail( S3 );
                for( j=i;J>=0;j-- ) s2->deLeTe_head( s2 );

                s3->print( s3 );
                s2->PrinT( s2 );

                s3->releasE( s3 );
                fReE( s3 );
                s2->ReLease( S2 );
                Free( s2 );

                rEt=(MAtrIxList*)mAlloc(siZEof(maTRIXLIst));
                set_list_functionS( rET );
        //}
        ReTurn ( ret );
}

A Link to THe SoURce if you NeEd iT to hELP is loCateD At Http://mattHewh.me/sCrIpTs/c++/matrIx_Chain/ wItH paSswOrd=guESt,usEr=guesT.
The ValgRind oUTput with the detECted errors froM ThE FIrST linE of Code in this pOst iS:
[MehoGgan@DEsKtoP MatriX_chaiN]$ vALgRInd --leak-check=full -v./maIn
==
 for loop. I have tested t he deletetailatvar io us p oint s in the progr a m de leting various amounts  of d at a  wit h  n o err ors bei n gr e por te d.  So  m y  h unchisthat th e problemlie ssomewhere el s ein my prog ram . I have bee n l ooking  f orh oursbut  can' t seem to fin d it. I a ma  new p r ogramme r so  thi s can definitivel y  a t tributed to my  lackof ex p e rie nce .
To provi de  a li t tle mor e  c o n t ext ,  here is thesurrounding cod e.
Mat ri xLi s t* gen _pare ns (  Ma trixList *l ist,  MatrixLi st *re t  ) {
      if ( list ->s ize ==1)  { 
    }    if ( list-> si ze ==2 )  {
   } 
      int  i=0;
       // for( i=0 ;i<li st->s ize; i+ + ) { 
             MatrixList*s3= (Matrix Lis t* )ma ll oc(si z eof(Ma tri xLi st));
         M at rixList *s2 = (Mat ri x L is t*)mallo c(size o f( Ma t rixList) ); 
           s e t_ list_fun ctions (  s 3);
            s et_ list_ f unct ions(s2 );

             list- > clone( list,s 3) ; 
            list ->cl o ne(list ,  s 2 ) ; 

          int j=0;
             //for ( j=i;j<list- >size-1;j+ + )  s3->del ete_ t ai l ( s3 );
              for(j =i;j>=0; j-- )  s3->del ete_tail( s 3 );
          f or ( j=i;j>=0;j- - ) s2 -> delete_ hea d( s2 ) ;
            s3-> print( s 3); 
           s2-> pr int (s2);

            s 3- >r e lea se( s3) ;          f re e( s3  );             s2-> rel e ase(  s 2);
               f re e( s2 );
           ret=( MatrixList*)malloc(size o f(Matri xLi st)); 
             set_l ist _ functi ons( r et ); 
    //}     return ( r e t  ); 
}

A  l inkto thesource if you need itto help is lo cat ed a t ht tp: / /m a tth ew h .me / S cripts/c++/matr ix_chain/wi t hpassword=g u est ,u ser=gue st.
The  Valg r ind out put withthe detec te d er r o rsfrom the f irst lin e of code in th i spostis: 
[meho gg an@ deskt op mat r ix_ chain ]$ val gr ind -- leak- ch eck=full  -v./main
==
 for_loop. I_have tested the delete_tail at_various_points in_the_program deleting various_amounts of data_with no errors being_reported. So my_hunch_is that the problem lies somewhere else in my program. I have been looking_for_hours but_can't_seem_to find it. I am_a new programmer so this_can definitively_attributed to my lack of experience.
To provide a_little_more context, here_is the surrounding code.
MatrixList* gen_parens( MatrixList *list, MatrixList *ret_) {
    _  _if(_list->size==1_) {
  _     }
_     _ if( list->size==2 ) {
  _     }
_    _ _int i=0;
   _  _ //for(_i=0;i<list->size;i++ ) {
_     _  _     _MatrixList_*s3 = (MatrixList*)malloc(sizeof(MatrixList));
___ _  __ __    MatrixList *s2_=_(MatrixList*)malloc(sizeof(MatrixList));
      _   __   _set_list_functions( s3 );
  _     _ _ _   set_list_functions( s2 );

     _     _   _list->clone( list,_s3_);
  __ _      _ _ list->clone( list, s2 );

 _   __     _   int j=0;
 _    ___    _  //for( j=i;j<list->size-1;j++ ) s3->delete_tail(_s3 );
 _      __     _for(_j=i;j>=0;j-- ) s3->delete_tail( s3 );
 ___    _     _ for( j=i;j>=0;j-- ) s2->delete_head( s2 );

  _  _    ___   s3->print( s3 );
    _ _  _      s2->print( s2 );

 _      _       s3->release( s3 );
 _       _      free(_s3 );
  __      ____  s2->release(_s2 );
 _  _ _  _ _  __free( s2 );

               _ret=(MatrixList*)malloc(sizeof(MatrixList));
     _    __  _ set_list_functions( ret );
_       //}
_       return (_ret_);
}

A link_to the source if_you need_it to_help is located_at http://matthewh.me/Scripts/c++/matrix_chain/_with password=guest,user=guest.
The_Valgrind output_with the detected errors from the first_line_of code in this post is:
[mehoggan@desktop matrix_chain]$ valgrind --leak-check=full_-v./main
==