Changeset 454 for trunk/src/samhain.c


Ignore:
Timestamp:
Jun 29, 2014, 7:30:04 AM (10 years ago)
Author:
katerina
Message:

Fix for ticket #355 (use calloc instead of malloc).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain.c

    r433 r454  
    150150int sh_g_thread()
    151151{
    152   struct gt * ptr = malloc(sizeof(struct gt));
     152  struct gt * ptr = calloc(1,sizeof(struct gt));
    153153  if (!ptr)
    154154    return -1;
     
    640640  /* The struct to hold privileged information.
    641641   */
    642   skey = (sh_key_t *) malloc (sizeof(sh_key_t));
     642  skey = calloc(1,sizeof(sh_key_t));
    643643  if (skey != NULL)
    644644    {
     
    862862  SH_MUTEX_LOCK(mutex_readdir);
    863863
    864   pidlist =  malloc(sizeof(pid_t) * 65535);
     864  pidlist =  calloc(1, sizeof(pid_t) * 65535);
    865865  if (!pidlist)
    866866    goto unlock_and_out;
     
    13761376      if (tzlen < 1024)
    13771377        {
    1378           sh.timezone = malloc (tzlen + 1);
     1378          sh.timezone = calloc(1, tzlen + 1);
    13791379          if (sh.timezone != NULL)
    13801380            (void) sl_strlcpy (sh.timezone, tzptr, tzlen + 1);
Note: See TracChangeset for help on using the changeset viewer.