summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher L. Farrow <cfarrow@enthought.com>2011-08-10 12:52:21 -0500
committerCharles Harris <charlesr.harris@gmail.com>2011-10-02 09:09:39 -0600
commitbe52978667fd10d26c9c0013385513eaece78dd3 (patch)
tree149b50af40936047132de09b1973ddda70a466c4
parent1f20595a834712e2e8451cd10a2b04b638bef72a (diff)
downloadnumpy-be52978667fd10d26c9c0013385513eaece78dd3.tar.gz
BUG: Fixing reference leak in datetime metadata retrieval
-rw-r--r--numpy/core/src/multiarray/datetime.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c
index 294912821..8f6403e34 100644
--- a/numpy/core/src/multiarray/datetime.c
+++ b/numpy/core/src/multiarray/datetime.c
@@ -807,6 +807,7 @@ get_datetime_metadata_from_dtype(PyArray_Descr *dtype)
/* Check that the dtype has an NpyCapsule for the metadata */
meta = (PyArray_DatetimeMetaData *)NpyCapsule_AsVoidPtr(metacobj);
+ Py_DECREF(metacobj);
if (meta == NULL) {
PyErr_SetString(PyExc_TypeError,
"Datetime type object is invalid, unit metadata is corrupt");