Index: lib/evt.c =================================================================== --- lib/evt.c (revision 2145) +++ lib/evt.c (revision 2146) @@ -637,6 +637,11 @@ continue; /* next poll */ } + if (dispatch_avail == -1) { + error = SA_AIS_ERR_LIBRARY; + goto dispatch_unlock; + } + /* * Make copy of callbacks, message data, unlock instance, * and call callback. A risk of this dispatch method is that Index: lib/cfg.c =================================================================== --- lib/cfg.c (revision 2145) +++ lib/cfg.c (revision 2146) @@ -207,6 +207,11 @@ continue; /* next poll */ } + if (dispatch_avail == -1) { + error = SA_AIS_ERR_LIBRARY; + goto error_nounlock; + } + /* * Make copy of callbacks, message data, unlock instance, and call callback * A risk of this dispatch method is that the callback routines may Index: lib/amf.c =================================================================== --- lib/amf.c (revision 2145) +++ lib/amf.c (revision 2146) @@ -228,6 +228,11 @@ continue; /* next poll */ } + if (dispatch_avail == -1) { + error = SA_AIS_ERR_LIBRARY; + goto error_nounlock; + } + /* * Make copy of callbacks, message data, unlock instance, and call callback * A risk of this dispatch method is that the callback routines may Index: lib/lck.c =================================================================== --- lib/lck.c (revision 2145) +++ lib/lck.c (revision 2146) @@ -382,6 +382,11 @@ continue; } + if (dispatch_avail == -1) { + error = SA_AIS_ERR_LIBRARY; + goto error_unlock; + } + /* * Make copy of callbacks, message data, unlock instance, * and call callback. A risk of this dispatch method is that Index: lib/msg.c =================================================================== --- lib/msg.c (revision 2145) +++ lib/msg.c (revision 2146) @@ -328,6 +328,11 @@ continue; } + if (dispatch_avail == -1) { + error = SA_AIS_ERR_LIBRARY; + goto error_unlock; + } + memset(&dispatch_data, 0, sizeof(struct message_overlay)); /*