Changeset 46

Show
Ignore:
Timestamp:
02/16/10 00:39:55 (7 months ago)
Author:
Carsten
Message:

Applied patches by Ettl Martin for fixing memory leaks in lwo library.
Closes #7 and #8.

Location:
cafu/trunk/ExtLibs/lwo
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/ExtLibs/lwo/lwio.c

    r31 r46  
    295295   if ( fseek( fp, pos, SEEK_SET )) { 
    296296      flen = FLEN_ERROR; 
     297      free(s); 
    297298      return NULL; 
    298299   } 
    299300   if ( 1 != fread( s, len, 1, fp )) { 
    300301      flen = FLEN_ERROR; 
     302      free(s); 
    301303      return NULL; 
    302304   } 
  • cafu/trunk/ExtLibs/lwo/lwob.c

    r31 r46  
    109109 
    110110   for ( i = 0; i < 3; i++ ) { 
     111 
    111112      env = calloc( 1, sizeof( lwEnvelope )); 
     113      if(!env) 
     114         return 0; 
     115 
    112116      key0 = calloc( 1, sizeof( lwKey )); 
     117      if(!key0) 
     118      { 
     119         free(env); 
     120         return 0; 
     121      } 
     122 
    113123      key1 = calloc( 1, sizeof( lwKey )); 
    114       if ( !env || !key0 || !key1 ) return 0; 
     124      if (!key1) 
     125      { 
     126         free(env); 
     127         free(key0); 
     128         return 0; 
     129      } 
    115130 
    116131      key0->next = key1;