Fix another leak.
This commit is contained in:
parent
50cff8ebc8
commit
e273b4e08e
11
src/rc/rc.c
11
src/rc/rc.c
@ -733,17 +733,18 @@ static void do_newlevel(const char *newlevel)
|
||||
static bool runlevel_config(const char *service, const char *level)
|
||||
{
|
||||
char *init = rc_service_resolve(service);
|
||||
char *conf;
|
||||
char *conf, *dir;
|
||||
size_t l;
|
||||
bool retval;
|
||||
|
||||
init = dirname(init);
|
||||
init = dirname(init);
|
||||
l = strlen(init) + strlen(level) + strlen(service) + 10;
|
||||
dir = dirname(init);
|
||||
dir = dirname(init);
|
||||
l = strlen(dir) + strlen(level) + strlen(service) + 10;
|
||||
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);
|
||||
free(conf);
|
||||
free(init);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user