From ac63793036c6d830d002241a750691b26235b3e1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 6 Apr 2009 23:30:44 +0200 Subject: [PATCH] Avoid null ptr ref for for yaz_poll errors. When yaz_poll returns error (-1) and errno is not EINTR the code previously assumed seshigh IOCHAN (client_link) and called cs_close.. In the mother process, however, the IOCHAN data is not this type. Code now prints a warning and resumes processing and does not use iochan_getdata. --- src/eventl.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/eventl.c b/src/eventl.c index 8c7d3ab..e8f6324 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -138,15 +138,9 @@ int iochan_event_loop(IOCHAN *iochans) } else { - /* Destroy the first member in the chain, and try again */ - association *assoc = (association *)iochan_getdata(*iochans); - COMSTACK conn = assoc->client_link; - - cs_close(conn); - destroy_association(assoc); - iochan_destroy(*iochans); - yaz_log(log_level, "error select, destroying iochan %p", - *iochans); + yaz_log(YLOG_WARN|YLOG_ERRNO, "yaz_poll"); + xfree(fds); + continue; } } now = time(0); -- 1.7.10.4