diff options
author | Sverker Eriksson <[email protected]> | 2012-03-20 11:09:54 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-03-20 11:10:55 +0100 |
commit | 46dd06a64dc5e14aec5921b293135713baa64059 (patch) | |
tree | 81da947af74d87c15a2c002e52ffb8c727200501 /erts/emulator | |
parent | 28b02062268eece4087b2e441b374ee00e721665 (diff) | |
parent | 2fbe8cc9b3f6f443ccccfaa485b05966aacc65d9 (diff) | |
download | otp-46dd06a64dc5e14aec5921b293135713baa64059.tar.gz otp-46dd06a64dc5e14aec5921b293135713baa64059.tar.bz2 otp-46dd06a64dc5e14aec5921b293135713baa64059.zip |
Merge branch 'sverk/zlib_port_leak' into maint
* sverk/zlib_port_leak:
Fix port leaks in zlib
OTP-9981
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/drivers/common/zlib_drv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/erts/emulator/drivers/common/zlib_drv.c b/erts/emulator/drivers/common/zlib_drv.c index da4a17db1a..a4b02b845e 100644 --- a/erts/emulator/drivers/common/zlib_drv.c +++ b/erts/emulator/drivers/common/zlib_drv.c @@ -64,6 +64,7 @@ static int zlib_init(void); static ErlDrvData zlib_start(ErlDrvPort port, char* buf); static void zlib_stop(ErlDrvData e); +static void zlib_flush(ErlDrvData e); static ErlDrvSSizeT zlib_ctl(ErlDrvData drv_data, unsigned int command, char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen); static void zlib_outputv(ErlDrvData drv_data, ErlIOVec *ev); @@ -82,7 +83,7 @@ ErlDrvEntry zlib_driver_entry = { NULL, /* timeout */ zlib_outputv, NULL, /* read_async */ - NULL, /* flush */ + zlib_flush, NULL, /* call */ NULL, /* event */ ERL_DRV_EXTENDED_MARKER, @@ -410,6 +411,13 @@ static void zlib_stop(ErlDrvData e) driver_free(d); } +static void zlib_flush(ErlDrvData drv_data) +{ + ZLibData* d = (ZLibData*) drv_data; + + driver_deq(d->port, driver_sizeq(d->port)); +} + static ErlDrvSSizeT zlib_ctl(ErlDrvData drv_data, unsigned int command, char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) { |