Changeset 82dc7d35bbaadf8d6f995fa74cd2135e6764188d

Show
Ignore:
Timestamp:
10/19/11 01:27:04 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1318987624 -0400
git-parent:

[cd621c2ce13e17f28a2aa89767ff1a14fe787306]

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

These are all memory leak fixes.
They are low priority leaks as they only happen at boot and
only consititue a one-time loss of 200 bytes or so on my box.
Cleanliness is cleanliness.

Files:

Legend:

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

    rb1133af r82dc7d3  
    575575  } \ 
    576576} while(0) 
    577 #define RETURN_INT(L, func) do { \ 
     577#define RETURN_INT(L, func, expr) do { \ 
    578578  int base = lua_gettop(L); \ 
    579579  assert(base == 1); \ 
     
    582582    rv = lua_tointeger(L, -1); \ 
    583583    lua_pop(L, 1); \ 
     584    expr \ 
    584585    return rv; \ 
    585586  } \ 
     
    596597  noit_lua_setup_module(L, mod); 
    597598  noit_lua_hash_to_table(L, options); 
     599  noit_hash_destroy(options, free, free); 
     600  free(options); 
    598601  lua_pcall(L, 2, 1, 0); 
    599602 
    600   RETURN_INT(L, "config"); 
     603  /* If rv == 0, the caller will free options. We've 
     604   * already freed options, that would be bad. fudge -> 1 */ 
     605  RETURN_INT(L, "config", { rv = (rv == 0) ? 1 : rv; }); 
    601606  return -1; 
    602607} 
     
    609614  lua_pcall(L, 1, 1, 0); 
    610615 
    611   RETURN_INT(L, "init"); 
     616  RETURN_INT(L, "init", ); 
    612617  return -1; 
    613618} 
  • src/noit_check_log.c

    r87107a8 r82dc7d3  
    392392  } 
    393393  free(bundle.metrics); 
     394  free(bundle.status); 
    394395  return rv; 
    395396} 
  • src/noit_conf.c

    r2357078 r82dc7d3  
    307307      strlcat(infile, path, PATH_MAX); 
    308308    } 
     309    xmlFree(path); 
    309310    config_include_nodes[i].doc = xmlParseFile(infile); 
    310311    if(config_include_nodes[i].doc) { 
     
    460461    snprintf(xpath_expr, sizeof(xpath_expr), "//*[@id=\"%s\"]", inheritid); 
    461462    noit_conf_get_into_hash(NULL, xpath_expr, table); 
     463    xmlFree(inheritid); 
    462464  } 
    463465  /* 3. */ 
  • src/noit_module.c

    re2ae3ee r82dc7d3  
    509509      continue; 
    510510    } 
    511     config = noit_conf_get_hash(sections[i], "config"); 
    512511    if(module->config) { 
    513512      int rv; 
     513      config = noit_conf_get_hash(sections[i], "config"); 
    514514      rv = module->config(module, config); 
    515515      if(rv == 0) {