mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Free memory buffer after closing port
This commit is contained in:
parent
4a2ef06b17
commit
1e2dac3026
1 changed files with 6 additions and 0 deletions
|
@ -2442,6 +2442,12 @@ object Cyc_io_close_port(void *data, object port)
|
||||||
if (stream)
|
if (stream)
|
||||||
fclose(stream);
|
fclose(stream);
|
||||||
((port_type *) port)->fp = NULL;
|
((port_type *) port)->fp = NULL;
|
||||||
|
|
||||||
|
if (((port_type *)port)->mem_buf != NULL){
|
||||||
|
free( ((port_type *)port)->mem_buf );
|
||||||
|
((port_type *)port)->mem_buf = NULL;
|
||||||
|
((port_type *)port)->mem_buf_len = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue