From a8cfb1a8658859b67259891f9a39a833a0653873 Mon Sep 17 00:00:00 2001 From: zjweiss <70495470+zjweiss@users.noreply.github.com> Date: Fri, 3 Oct 2025 18:37:15 -0400 Subject: [PATCH] Call free on vecs and lens before returning a TypeError Previously, this could cause some asan issues as these objects were not deleted. --- 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"