Show
Ignore:
Timestamp:
04/27/08 01:17:08 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1209259028 +0000
git-parent:

[4c05448ea043aaf96b94270f68092553c96ccd9d]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1209259028 +0000
Message:

various valgrind noted leaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_conf.c

    r4c05448 r01dbb0d  
    134134                      strdup((char *)node->name), strlen((char *)node->name), 
    135135                      strdup(value), free, free); 
     136    xmlFree(value); 
    136137  } 
    137138 out: 
     
    255256                          const char *path, char **value) { 
    256257  char *str; 
    257   int i
    258   xmlXPathObjectPtr pobj
     258  int i, rv = 1
     259  xmlXPathObjectPtr pobj = NULL
    259260  xmlXPathContextPtr current_ctxt; 
    260261  xmlNodePtr current_node = (xmlNodePtr)section; 
     
    284285  if(noit_hash_retrieve(&_compiled_fallback, 
    285286                        path, strlen(path), (void **)&str)) { 
    286     *value = str
     287    *value = (char *)xmlStrdup((xmlChar *)str)
    287288    goto found; 
    288289  } 
     290  rv = 0; 
     291 found: 
     292  if(pobj) xmlXPathFreeObject(pobj); 
    289293  if(current_ctxt && current_ctxt != xpath_ctxt) 
    290294    xmlXPathFreeContext(current_ctxt); 
    291   return 0; 
    292  found: 
    293   if(current_ctxt && current_ctxt != xpath_ctxt) 
    294     xmlXPathFreeContext(current_ctxt); 
    295   return 1; 
     295  return rv; 
    296296} 
    297297int noit_conf_get_uuid(noit_conf_section_t section, 
     
    309309  if(_noit_conf_get_string(section,NULL,path,&str)) { 
    310310    *value = strdup(str); 
     311    xmlFree(str); 
    311312    return 1; 
    312313  } 
     
    318319  if(_noit_conf_get_string(section,NULL,path,&str)) { 
    319320    strlcpy(buf, str, len); 
     321    xmlFree(str); 
    320322    return 1; 
    321323  } 
     
    340342    } 
    341343    longval = strtol(str, NULL, base); 
     344    xmlFree(str); 
    342345    *value = (int)longval; 
    343346    return 1; 
     
    356359  if(_noit_conf_get_string(section,NULL,path,&str)) { 
    357360    *value = atof(str); 
     361    xmlFree(str); 
    358362    return 1; 
    359363  } 
     
    373377       !strcasecmp(str, "on")) *value = noit_true; 
    374378    else *value = noit_false; 
     379    xmlFree(str); 
    375380    return 1; 
    376381  }