Fix memory leak on error path and proper polling vs async conditions

This commit is contained in:
Mark Pizzolato 2011-11-02 05:45:01 -07:00
parent fd5de0d005
commit cbc14bc010
2 changed files with 4 additions and 3 deletions

View file

@ -2584,6 +2584,7 @@ t_stat xq_attach(UNIT* uptr, char* cptr)
if (xq->var->poll == 0) {
status = eth_set_async(xq->var->etherface, xq->var->coalesce_latency_ticks);
if (status != SCPE_OK) {
eth_close(xq->var->etherface);
free(tptr);
free(xq->var->etherface);
xq->var->etherface = NULL;

View file

@ -87,7 +87,7 @@ extern int32 int_req[IPL_HLVL];
#define XQ_QUE_MAX 500 /* read queue size in packets */
#define XQ_FILTER_MAX 14 /* number of filters allowed */
#if defined SIM_ASYNCH_IO
#if defined(SIM_ASYNCH_IO) && defined(USE_READER_THREAD)
#define XQ_SERVICE_INTERVAL 0 /* polling interval - No Polling with Asynch I/O */
#else
#define XQ_SERVICE_INTERVAL 100 /* polling interval - X per second */