aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-27 12:06:19 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-27 12:06:19 -0500
commit3a803b3135837665d51ef4dd7a8b913c78e71ff6 (patch)
tree149c3c1f737dd7432911d512c2ce736153bfbbc1
parent72df51e17ba0e1a0f94451b4bbfb338288c4625c (diff)
librc-daemon.c: fix memory leaks
-rw-r--r--src/librc/librc-daemon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 173fcb83..6f3b492f 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -422,6 +422,7 @@ rc_service_daemon_set(const char *service, const char *exec,
rename(file, oldfile);
strlcpy(oldfile, file, sizeof(oldfile));
}
+ free(file);
}
closedir(dp);
rc_stringlist_free(match);
@@ -446,10 +447,12 @@ rc_service_daemon_set(const char *service, const char *exec,
fclose(fp);
retval = true;
}
+ free(file);
}
} else
retval = true;
+ free(dirpath);
return retval;
}
librc_hidden_def(rc_service_daemon_set)