diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-28 13:12:40 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-28 13:12:40 +0100 |
commit | 2c47dd98c57084f7cdf5a20edb2ad31e001ab8ad (patch) | |
tree | 4689a5e069c31f039682b856271797c80eee514b /libs/vfork | |
parent | 78bd97ac9a7615b9af635ad8fc5298a6368704a7 (diff) |
silence clang analyzer: Memory Error, Memory leak
Diffstat (limited to 'libs/vfork')
-rw-r--r-- | libs/vfork/exec_wrapper.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/vfork/exec_wrapper.c b/libs/vfork/exec_wrapper.c index e1669fbae1..adc568fd45 100644 --- a/libs/vfork/exec_wrapper.c +++ b/libs/vfork/exec_wrapper.c @@ -113,5 +113,14 @@ int main(int argc, char *argv[]) { char buf = 0; (void) write(pok[1], &buf, 1 ); close_fd(&pok[1]); + +#ifdef __clang_analyzer__ + // the clang static analyzer warns about a memleak here, + // but we don't care. The OS will clean up after us in a jiffy. + for (i=0; envp && envp[i]; ++i) { + free (envp[i]); + } + free (envp); +#endif return -1; } |