Skip to content

Commit

Permalink
erts: Fix binary memory leak in ttsl driver
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Aug 18, 2015
1 parent 61828f7 commit d2bb1ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erts/emulator/drivers/unix/ttsl_drv.c
Expand Up @@ -720,6 +720,7 @@ static void ttysl_from_erlang(ErlDrvData ttysl_data, char* buf, ErlDrvSizeT coun
}

driver_enq_bin(ttysl_port,putcbuf,0,putcpos);
driver_free_binary(putcbuf);

if (sz == 0) {
for (;;) {
Expand Down Expand Up @@ -1207,6 +1208,7 @@ static int outc(int c)
putcbuf->orig_bytes[putcpos++] = c;
if (putcpos == putclen) {
driver_enq_bin(ttysl_port,putcbuf,0,putclen);
driver_free_binary(putcbuf);
putcpos = 0;
putclen = TTY_BUFFSIZE;
putcbuf = driver_alloc_binary(BUFSIZ);
Expand Down

0 comments on commit d2bb1ca

Please sign in to comment.