summaryrefslogtreecommitdiff
path: root/libs/vfork
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-28 13:12:40 +0100
committerRobin Gareus <robin@gareus.org>2016-02-28 13:12:40 +0100
commit2c47dd98c57084f7cdf5a20edb2ad31e001ab8ad (patch)
tree4689a5e069c31f039682b856271797c80eee514b /libs/vfork
parent78bd97ac9a7615b9af635ad8fc5298a6368704a7 (diff)
silence clang analyzer: Memory Error, Memory leak
Diffstat (limited to 'libs/vfork')
-rw-r--r--libs/vfork/exec_wrapper.c9
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;
}