s3: Survive an idle child that was killed
[obnox/samba-ctdb.git] / source3 / modules / vfs_aio_fork.c
index 512ae436e85d171808c122acc5542f78a550bde9..9291122270f91cf30412810ff48bd504451f1680 100644 (file)
@@ -397,6 +397,12 @@ static void handle_aio_completion(struct event_context *event_ctx,
                child->retval.ret_errno = EIO;
        }
 
+       if (child->aiocb == NULL) {
+               DEBUG(1, ("Inactive child died\n"));
+               TALLOC_FREE(child);
+               return;
+       }
+
        if (child->cancelled) {
                child->aiocb = NULL;
                child->cancelled = false;