Changeset 337 for trunk/src


Ignore:
Timestamp:
Apr 30, 2011, 11:43:29 AM (14 years ago)
Author:
katerina
Message:

Fix segfault on reload in sh_log_evalrule.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_log_evalrule.c

    r285 r337  
    186186
    187187  ng = SH_ALLOC(sizeof(struct sh_geval));
     188  memset(ng, '\0', sizeof(struct sh_geval));
     189
    188190  ng->label       = sh_string_new_from_lchar(splits[0], lengths[0]);
    189191  ng->flags       = RFL_ISGROUP;
     
    292294
    293295  nh = SH_ALLOC(sizeof(struct sh_heval));
     296  memset(nh, '\0', sizeof(struct sh_heval));
     297
    294298  nh->hostname = host;
    295299  nh->hostname_extra = host_extra;
     
    358362
    359363  nq = SH_ALLOC(sizeof(struct sh_qeval));
     364  memset(nq, '\0', sizeof(struct sh_qeval));
     365
    360366  nq->label = sh_string_new_from_lchar(splits[0], lengths[0]);
    361367  nq->alias = NULL;
     
    609615
    610616  nr = SH_ALLOC(sizeof(struct sh_geval));
     617  memset(nr, '\0', sizeof(struct sh_geval));
     618
    611619  nr->label       = NULL;
    612620  nr->flags       = RFL_ISRULE;
     
    789797      if (htmp->hostname_extra) (*pcre_free)(htmp->hostname_extra);
    790798      if (htmp->hostname)       (*pcre_free)(htmp->hostname);
     799      if (htmp->rulegroups)     htmp->rulegroups = NULL;
    791800      hostlist = htmp->next;
     801      htmp->next = NULL;
    792802      SH_FREE(htmp);
    793803      htmp = hostlist;
    794804    }
     805
     806  hostlist   = NULL;
     807  queuelist  = NULL;
     808  grouplist  = NULL;
     809
     810  host_open  = NULL;
     811  group_open = NULL;
    795812
    796813  sh_keep_destroy();
     
    11161133
    11171134      counter = SH_ALLOC(sizeof(struct sh_ceval));
     1135      memset(counter, '\0', sizeof(struct sh_ceval));
     1136
    11181137      counter->hostname    = sh_string_new_from_lchar(sh_string_str(host),
    11191138                                                      sh_string_len(host));
Note: See TracChangeset for help on using the changeset viewer.