Fix memory leak pointed out by Coverity.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 26 Nov 2018 01:28:09 +0000 (10:28 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 26 Nov 2018 01:28:09 +0000 (10:28 +0900)
src/protocol/child.c

index 9abb4af8daeaebabf11eb41b3499222b41769bd1..6869c5c6c479d75544997baa4d53d14f312b62db 100644 (file)
@@ -2105,15 +2105,17 @@ validate_backend_connectivity(int front_end_fd)
                                                                                error_hint,
                                                                                __FILE__,
                                                                                __LINE__);
+                               
                        }
                        PG_CATCH();
                        {
+                               pool_free_startup_packet(sp);
                                FlushErrorState();
                                ereport(FATAL,
                                                (errmsg("%s", error_msg), errdetail("%s", error_detail), errhint("%s", error_hint)));
-                               pfree(sp);
                        }
                        PG_END_TRY();
+                       pool_free_startup_packet(sp);
                }
                ereport(FATAL,
                                (errmsg("%s", error_msg), errdetail("%s", error_detail), errhint("%s", error_hint)));