aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2015-08-18 16:39:07 +0200
committerErlang/OTP <[email protected]>2015-08-18 16:39:07 +0200
commit99461fca5e224cda77174bb1b5ccee47969e9874 (patch)
treef0870810d5bc2ec4fa372c879b297f775f98c5b7 /erts
parent61828f77ca2542109ece006d730a4f8fe3300616 (diff)
parentd2bb1ca56dcd0ab8e5b43c4368409317c3ddd4db (diff)
downloadotp-99461fca5e224cda77174bb1b5ccee47969e9874.tar.gz
otp-99461fca5e224cda77174bb1b5ccee47969e9874.tar.bz2
otp-99461fca5e224cda77174bb1b5ccee47969e9874.zip
Merge branch 'lukas/erts/fix_ttsl_binary_leak/OTP-12941' into maint-18
* lukas/erts/fix_ttsl_binary_leak/OTP-12941: erts: Fix binary memory leak in ttsl driver
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/drivers/unix/ttsl_drv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c
index 0f773b69fb..53146e71f0 100644
--- a/erts/emulator/drivers/unix/ttsl_drv.c
+++ b/erts/emulator/drivers/unix/ttsl_drv.c
@@ -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 (;;) {
@@ -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);