Skip to content

Commit

Permalink
Merge pull request #198 from eltoder/fix-leak-clib-info
Browse files Browse the repository at this point in the history
Fix memory leak in PyBlosc_clib_info.
  • Loading branch information
FrancescAlted committed Jun 19, 2019
2 parents 6055b55 + ceac456 commit 1bf09ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blosc/blosc_extension.c
Expand Up @@ -158,14 +158,18 @@ PyBlosc_clib_info(PyObject *self, PyObject *args)
char *cname;
char *clib;
char *version;
PyObject *info;

if (!PyArg_ParseTuple(args, "s:clib_info", &cname))
return NULL;

if (blosc_get_complib_info(cname, &clib, &version) < 0)
return NULL;

return Py_BuildValue("(s, s)", clib, version);
info = Py_BuildValue("(s, s)", clib, version);
free(clib);
free(version);
return info;
}


Expand Down

0 comments on commit 1bf09ad

Please sign in to comment.