From 3a803b3135837665d51ef4dd7a8b913c78e71ff6 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 27 Jun 2018 12:06:19 -0500 Subject: librc-daemon.c: fix memory leaks --- src/librc/librc-daemon.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/librc') 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) -- cgit v1.2.3