Fix possible null pointer dereference per Coverity.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 6 Apr 2022 05:50:56 +0000 (14:50 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 6 Apr 2022 05:52:52 +0000 (14:52 +0900)
src/protocol/child.c

index 79e70e65188cf7b4b697afbf59d1352b51c7829e..6d7c6688bbeb5a71e372c68ce0aa114ab8103af5 100644 (file)
@@ -503,8 +503,12 @@ backend_cleanup(POOL_CONNECTION * volatile *frontend, POOL_CONNECTION_POOL * vol
         * Close frontend connection
         */
        reset_connection();
-       pool_close(*frontend);
-       *frontend = NULL;
+
+       if (*frontend != NULL)
+       {
+               pool_close(*frontend);
+               *frontend = NULL;
+       }
 
        if (cache_connection == false)
        {