Show
Ignore:
Timestamp:
2006-05-18 10:35:29 (3 years ago)
Author:
Rocco Rutte <pdmef@…>
Branch:
HEAD
Message:

Avoid safe_free() usage and add security checks

Add checks to check_sec.sh for memory functions.

These include a check for use of safe_free() instead of FREE() and a
check whether FREE(&...) is used.

For the former, SAFE_FREE_CHECKED is to be used, for the latter
FREE_CHECKED to avoid messages from check_sec.sh

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • muttlib.c

    r4628 r4640  
    292292  FREE (&(*h)->data); 
    293293#endif 
    294   FREE (h); 
     294  FREE (h);             /* __FREE_CHECKED__ */ 
    295295} 
    296296 
     
    680680  mutt_free_list (&(*p)->in_reply_to); 
    681681  mutt_free_list (&(*p)->userhdrs); 
    682   FREE (p); 
     682  FREE (p);             /* __FREE_CHECKED__ */ 
    683683} 
    684684 
     
    914914          break; 
    915915        case 1:         /* yes */ 
    916           FREE (directory); 
     916          FREE (directory);             /* __FREE_CHECKED__ */ 
    917917          break; 
    918918        case -1:        /* abort */ 
    919           FREE (directory);  
     919          FREE (directory);             /* __FREE_CHECKED__ */ 
    920920          return -1; 
    921921        case  2:        /* no */ 
    922           FREE (directory); 
     922          FREE (directory);             /* __FREE_CHECKED__ */ 
    923923          return 1; 
    924924      } 
     
    13941394  else 
    13951395  { 
    1396     safe_free(&b->data); 
     1396    FREE(&b->data); 
    13971397  } 
    13981398  memset(b, 0, sizeof(BUFFER)); 
     
    14741474   FREE(&(*p)->data); 
    14751475   /* dptr is just an offset to data and shouldn't be freed */ 
    1476    FREE(p); 
     1476   FREE(p);             /* __FREE_CHECKED__ */ 
    14771477} 
    14781478 
     
    15461546  regfree ((*pp)->rx); 
    15471547  FREE (&(*pp)->rx); 
    1548   FREE (pp); 
     1548  FREE (pp);            /* __FREE_CHECKED__ */ 
    15491549} 
    15501550 
     
    15731573    *list = (*list)->next; 
    15741574    mutt_free_regexp (&p->rx); 
    1575     safe_free(&p->template); 
     1575    FREE (&p->template); 
    15761576    FREE (&p); 
    15771577  }