Fix memory leak in replication mode.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 25 Sep 2019 05:22:21 +0000 (14:22 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 25 Sep 2019 05:27:28 +0000 (14:27 +0900)
Per coverity.

src/protocol/pool_process_query.c

index ef773b2ea479075bcce0afff4fa6b7f7190d0026..7efd9bb62ee015b2bdfe738d56959335d8262f17 100644 (file)
@@ -3188,9 +3188,10 @@ POOL_STATUS insert_lock(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend
                                }
                                else if (lock_kind == 2)
                                {
-                                       POOL_SELECT_RESULT *result;
                                        per_node_statement_log(backend, i, qbuf);
-                                       do_query(CONNECTION(backend,i), qbuf, &result, MAJOR(backend));
+                                       do_query(CONNECTION(backend, i), qbuf, &result, MAJOR(backend));
+                                       if (result)
+                                               free_select_result(result);
                                }
                        }