printing: Avoid EBADF from EPOLL_CTL_DEL
authorVolker Lendecke <vl@samba.org>
Thu, 9 Jan 2020 13:43:02 +0000 (14:43 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 9 Jan 2020 18:55:36 +0000 (18:55 +0000)
TALLOC_FREE the fde before closing the fd. Otherwise the fde
destructor tries to remove a nonexisting fd from the epoll set.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/print_cups.c

index 96bda2d34b6240befdce28f5ac3a0a749831b211..b52f7e25da552ecc9b00f24366d04b00b4343792 100644 (file)
@@ -573,9 +573,9 @@ static void cups_async_callback(struct tevent_context *event_ctx,
 err_out:
        pcap_cache_destroy_specific(&tmp_pcap_cache);
        TALLOC_FREE(frame);
+       TALLOC_FREE(cache_fd_event);
        close(cb_args->pipe_fd);
        TALLOC_FREE(cb_args);
-       TALLOC_FREE(cache_fd_event);
 }
 
 bool cups_cache_reload(struct tevent_context *ev,