ref: 0f90115ff87e5866726c8c7d615f8293c39f21c5
parent: f56267814566dddb3d995e2ca067d73d71a4937f
author: james palmer <foura@biobuf.link>
date: Mon Jun 7 12:14:37 EDT 2021
aeventproc: malloc the Biobuf, it was overflowing the stack
--- a/event.c
+++ b/event.c
@@ -73,16 +73,18 @@
{
AWin *w;
Channel *c;
- Biobuf bio;
+ Biobuf *bio;
AEvent ev;
w = aux;
c = w->eventc;
- Binit(&bio, w->eventfd, OREAD);
+ bio = mallocz(sizeof(Biobuf), 1);
+ Binit(bio, w->eventfd, OREAD);
- while(aeventnext(&bio, &ev)) {
+ while(aeventnext(bio, &ev)) {
if(send(c, &ev) < 0) {
- Bterm(&bio);
+ Bterm(bio);
+ free(bio);
exits(nil);
}
}