Fix CreateShardConnectionHash memory leak

The call to hash_create specified HASH_CONTEXT without actually setting
one using the provided HASHCTL. The hashes returned by this function
are used locally, so simply using CurrentMemoryContext is sufficient.
pull/768/head
Jason Petersen 2016-09-02 16:22:32 -04:00
parent 6333f9ba6f
commit b3684074f3
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "distributed/master_metadata_utility.h"
#include "distributed/multi_shard_transaction.h"
#include "nodes/pg_list.h"
#include "utils/memutils.h"
#define INITIAL_CONNECTION_CACHE_SIZE 1001
@ -92,6 +93,7 @@ CreateShardConnectionHash(void)
info.keysize = sizeof(int64);
info.entrysize = sizeof(ShardConnections);
info.hash = tag_hash;
info.hcxt = TopTransactionContext;
hashFlags = HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT;
shardConnectionsHash = hash_create("Shard Connections Hash",