https://github.com/python/cpython/commit/11d77d21120b77ddfd97f471c0d7a31745141131
commit: 11d77d21120b77ddfd97f471c0d7a31745141131
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: ericsnowcurrently <[email protected]>
date: 2025-05-21T19:35:31Z
summary:

[3.14] gh-132983: Fix refleak in zstd dictionary functions (gh-134463)

(cherry picked from commit fb68776591485, AKA gh-134459)

Co-authored-by: Emma Smith <[email protected]>

files:
M Modules/_zstd/_zstdmodule.c

diff --git a/Modules/_zstd/_zstdmodule.c b/Modules/_zstd/_zstdmodule.c
index b2e4f95b906356..17d3bff1e98769 100644
--- a/Modules/_zstd/_zstdmodule.c
+++ b/Modules/_zstd/_zstdmodule.c
@@ -251,7 +251,7 @@ _zstd_train_dict_impl(PyObject *module, PyBytesObject 
*samples_bytes,
                                             &chunk_sizes);
     if (chunks_number < 0)
     {
-        return NULL;
+        goto error;
     }
 
     /* Allocate dict buffer */
@@ -333,7 +333,7 @@ _zstd_finalize_dict_impl(PyObject *module, PyBytesObject 
*custom_dict_bytes,
                                             &chunk_sizes);
     if (chunks_number < 0)
     {
-        return NULL;
+        goto error;
     }
 
     /* Allocate dict buffer */

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to