Skip to content

Commit

Permalink
BUG: Fixing reference leak in datetime metadata retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
cfarrow authored and charris committed Oct 2, 2011
1 parent 1f20595 commit be52978
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions numpy/core/src/multiarray/datetime.c
Expand Up @@ -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");
Expand Down

0 comments on commit be52978

Please sign in to comment.