librc-daemon.c: fix memory leaks
This commit is contained in:
parent
72df51e17b
commit
3a803b3135
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user