aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-04-29 11:08:02 +0000
committerRoy Marples <roy@marples.name>2008-04-29 11:08:02 +0000
commite273b4e08ee0ebc1a001d60e2a5b65a9553a8a8a (patch)
tree7ed64158e1a52dd760f77e184240b6a27c968fc9 /src
parent50cff8ebc8dd531452e54ca8c411a0c6649e1f8e (diff)
Fix another leak.
Diffstat (limited to 'src')
-rw-r--r--src/rc/rc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 35e0bdd9..94292870 100644
--- a/src/rc/rc.c
+++ b/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;
}