diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-08-03 17:11:31 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-08-04 08:47:35 +0000 |
commit | dd84e5742cb2fc6aaa96aa0214e0ed3a963d68da (patch) | |
tree | a89627f958032c1cba4fe79d6d2683fcc18ed108 | |
parent | aeb4de9ccdbc0c896e71f5286ca767c8200278bf (diff) | |
download | raindrops-dd84e5742cb2fc6aaa96aa0214e0ed3a963d68da.tar.gz |
This is only possible during an exit if our invocation of rb_gc() fails and causes the process to terminate. Otherwise the GC won't free something that's obviously on the stack.
-rw-r--r-- | ext/raindrops/raindrops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/raindrops/raindrops.c b/ext/raindrops/raindrops.c index 65e3947..eb4694e 100644 --- a/ext/raindrops/raindrops.c +++ b/ext/raindrops/raindrops.c @@ -75,6 +75,7 @@ retry: r->drops = mmap(NULL, sizeof(struct raindrop) * r->size, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); if (r->drops == MAP_FAILED) { + r->drops = NULL; if ((errno == EAGAIN || errno == ENOMEM) && tries-- > 0) { rb_gc(); goto retry; |