Show
Ignore:
Timestamp:
09/14/11 21:15:59 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1316034959 -0400
git-parent:

[efaa4bef860c2bf077259435ade565fd8bad46bc]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1316034959 -0400
Message:

if no config node is passed, this would crash

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/check_test.c

    rbb10f44 rf0c65b7  
    124124  } 
    125125  conf_hash = calloc(1, sizeof(*conf_hash)); 
    126   for(co = config->children; co; co = co->next) { 
    127     char *name, *val; 
    128     xmlChar *tmp_val; 
    129     name = strdup((char *)co->name); 
    130     tmp_val = xmlNodeGetContent(co); 
    131     val = strdup(tmp_val ? (char *)tmp_val : ""); 
    132     noit_hash_replace(conf_hash, name, strlen(name), val, free, free); 
    133     xmlFree(tmp_val); 
     126  if(config) { 
     127    for(co = config->children; co; co = co->next) { 
     128      char *name, *val; 
     129      xmlChar *tmp_val; 
     130      name = strdup((char *)co->name); 
     131      tmp_val = xmlNodeGetContent(co); 
     132      val = strdup(tmp_val ? (char *)tmp_val : ""); 
     133      noit_hash_replace(conf_hash, name, strlen(name), val, free, free); 
     134      xmlFree(tmp_val); 
     135    } 
    134136  } 
    135137  if(!m->initiate_check) {