Fix another leak.

This commit is contained in:
Roy Marples 2008-04-29 11:08:02 +00:00
parent 50cff8ebc8
commit e273b4e08e

View File

@ -733,17 +733,18 @@ static void do_newlevel(const char *newlevel)
static bool runlevel_config(const char *service, const char *level) static bool runlevel_config(const char *service, const char *level)
{ {
char *init = rc_service_resolve(service); char *init = rc_service_resolve(service);
char *conf; char *conf, *dir;
size_t l; size_t l;
bool retval; bool retval;
init = dirname(init); dir = dirname(init);
init = dirname(init); dir = dirname(init);
l = strlen(init) + strlen(level) + strlen(service) + 10; l = strlen(dir) + strlen(level) + strlen(service) + 10;
conf = xmalloc(sizeof(char) * l); conf = xmalloc(sizeof(char) * l);
snprintf(conf, l, "%s/conf.d/%s.%s", init, service, level); snprintf(conf, l, "%s/conf.d/%s.%s", dir, service, level);
retval = exists(conf); retval = exists(conf);
free(conf); free(conf);
free(init);
return retval; return retval;
} }