From 6ac24e0f6109c5ca18d72acce18b4c93f8770109 Mon Sep 17 00:00:00 2001 From: zjweiss-google Date: Fri, 3 Oct 2025 16:06:44 -0700 Subject: [PATCH] Free dynamically allocated memory prior to returning error --- pandas/_libs/hashing.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/_libs/hashing.pyx b/pandas/_libs/hashing.pyx index a1fd70529efa7..280cbe024b36f 100644 --- a/pandas/_libs/hashing.pyx +++ b/pandas/_libs/hashing.pyx @@ -91,6 +91,8 @@ def hash_object_array( hash(val) data = str(val).encode(encoding) else: + free(vecs) + free(lens) raise TypeError( f"{val} of type {type(val)} is not a valid type for hashing, " "must be string or null"