From e40ccfd99e435134c1eb2a1ffd542435fd818c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Tue, 21 Jan 2025 10:41:51 +0100 Subject: [PATCH] Fix memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Viktor Söderqvist --- src/t_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_hash.c b/src/t_hash.c index f6e2986f59..e3f7ca9b2e 100644 --- a/src/t_hash.c +++ b/src/t_hash.c @@ -121,7 +121,7 @@ hashTypeEntry *hashTypeCreateEntry(sds field, sds value) { if (field_is_sds5) field_size += 2; size_t alloc_size = sizeof(void *) + field_size; hashTypeEntryPtrValue *entry = zmalloc(alloc_size); - entry->value = sdsdup(value); + entry->value = value; if (field_is_sds5) { /* We can't use SDS_TYPE_5 to encode extra information in the unused * allocation size, so convert to SDS_TYPE_8. */