1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 10:31:15 +02:00

Fix some memory leaks

This commit is contained in:
Eelco Dolstra 2014-12-12 15:01:16 +01:00
parent 28f22b4653
commit f52b6c944e
3 changed files with 27 additions and 35 deletions

View file

@ -289,6 +289,11 @@ string runProgram(Path program, bool searchPath = false,
MakeError(ExecError, Error)
/* Convert a list of strings to a null-terminated vector of char
*'s. The result must not be accessed beyond the lifetime of the
list of strings. */
std::vector<const char *> stringsToCharPtrs(const Strings & ss);
/* Close all file descriptors except stdin, stdout, stderr, and those
listed in the given set. Good practice in child processes. */
void closeMostFDs(const set<int> & exceptions);