Signed-off by: Rosen Penev <rosenp@gmail.com>
n_patterns = 1;
find_devs(true);
find_devs(false);
+ free(pattern);
return chdir("/");
}
if (fprintf(_pidfile, "%d\n", in->proc.pid) < 0) {
ERROR("failed to write pidfile: %s: %d (%s)",
in->pidfile, errno, strerror(errno));
+ fclose(_pidfile);
return 2;
}
if (fclose(_pidfile)) {
if (child == 0) {
char **_argv = calloc(argc + 1, sizeof(char *));
char **_envp;
- char preload[] = "LD_PRELOAD=/lib/libpreload-trace.so";
+ char *preload = "LD_PRELOAD=/lib/libpreload-trace.so";
int envc = 1;
int ret;
ret = execve(_argv[0], _argv, envp);
ERROR("failed to exec %s: %s\n", _argv[0], strerror(errno));
+
+ free(_argv);
+ free(_envp);
return ret;
}