From 9336ee5476661625577267ef2693b3f226bd6bdf Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 26 Oct 2023 22:57:27 +0300 Subject: [PATCH] Correctly free manual "small vector" in cluster_client %-) --- src/cluster_client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cluster_client.cpp b/src/cluster_client.cpp index 53427722..b098aa78 100644 --- a/src/cluster_client.cpp +++ b/src/cluster_client.cpp @@ -193,6 +193,10 @@ void cluster_client_t::inc_wait(uint64_t opcode, uint64_t flags, cluster_op_t *n bh_op_max *= 2; cluster_op_t **n = (cluster_op_t**)malloc_or_die(sizeof(cluster_op_t*) * bh_op_max); memcpy(n, bh_ops, sizeof(cluster_op_t*) * bh_op_count); + if (bh_ops != bh_ops_local) + { + free(bh_ops); + } bh_ops = n; } bh_ops[bh_op_count++] = next;