librc-daemon.c: fix memory leaks

This commit is contained in:
William Hubbs 2018-06-27 12:06:19 -05:00
parent 72df51e17b
commit 3a803b3135

View File

@ -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)