summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-08-23 19:26:40 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-08-23 19:26:40 +0200
commitdb228ac2de3515a726e786fddfd257b48c7e1c29 (patch)
tree10d8ddcf0c030f8e2a3f7f17bff6a9fc78fb77c2 /exec
parent8bbe158d77914520d2aa2e454eebeb0addfc63c1 (diff)
Fixes long-standing random hang of exec.
* exec.c (finish): Set FILE_DATA and MAP_BUFFER members of E to NULL after freeing them.
Diffstat (limited to 'exec')
-rw-r--r--exec/exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/exec/exec.c b/exec/exec.c
index cb3d7418..daa8a24b 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1008,10 +1008,13 @@ finish (struct execdata *e, int dealloc_file)
#ifdef EXECDATA_STREAM
fclose (&e->stream);
#else
- if (e->file_data != NULL)
+ if (e->file_data != NULL) {
free (e->file_data);
- else if (map_buffer (e) != NULL)
+ e->file_data = NULL;
+ } else if (map_buffer (e) != NULL) {
munmap (map_buffer (e), map_vsize (e));
+ map_buffer (e) = NULL;
+ }
#endif
}
if (dealloc_file && e->file != MACH_PORT_NULL)