]> granicus.if.org Git - python/commitdiff
bpo-35984: _xxsubinterpreters: Fix memory leak in _channel_send() (GH-11845)
authorAlexey Izbyshev <izbyshev@ispras.ru>
Fri, 15 Feb 2019 22:28:58 +0000 (01:28 +0300)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 15 Feb 2019 22:28:58 +0000 (14:28 -0800)
https://bugs.python.org/issue35984

Modules/_xxsubinterpretersmodule.c

index 235df7076f99812791c90460b5a5390108298d13..79c9def7262913ce5ac29fdb7a0661c3f0a02336 100644 (file)
@@ -1339,6 +1339,7 @@ _channel_send(_channels *channels, int64_t id, PyObject *obj)
         return -1;
     }
     if (_PyObject_GetCrossInterpreterData(obj, data) != 0) {
+        PyMem_Free(data);
         PyThread_release_lock(mutex);
         return -1;
     }