PengZheng commented on code in PR #448: URL: https://github.com/apache/celix/pull/448#discussion_r1035513751
########## bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_handler.c: ########## @@ -571,13 +571,15 @@ int pubsub_tcpHandler_listen(pubsub_tcpHandler_t *handle, char *url) { if (rc != 0) { L_ERROR("[TCP Socket] Error listen: %s\n", strerror(errno)); pubsub_tcpHandler_freeEntry(entry); + close(fd); entry = NULL; } } if (rc >= 0) { rc = pubsub_tcpHandler_makeNonBlocking(handle, fd); if (rc < 0) { pubsub_tcpHandler_freeEntry(entry); + close(fd); Review Comment: I also don't like the locking pattern here. Locking IO is anti-pattern, and should be totally avoided if possible. But that belongs to a separate PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org