fixd refleak

This commit is contained in:
Christian Heimes 2013-06-10 10:47:22 +02:00
parent 36451f076b
commit 75b8426698
1 changed files with 9 additions and 1 deletions

View File

@ -2775,6 +2775,7 @@ get_default_verify_paths(PyObject *self)
PyObject *ofile = NULL; PyObject *ofile = NULL;
PyObject *odir_env = NULL; PyObject *odir_env = NULL;
PyObject *odir = NULL; PyObject *odir = NULL;
PyObject *tup = NULL;
#define convert(info, target) { \ #define convert(info, target) { \
const char *tmp = (info); \ const char *tmp = (info); \
@ -2791,7 +2792,14 @@ get_default_verify_paths(PyObject *self)
convert(X509_get_default_cert_dir(), odir); convert(X509_get_default_cert_dir(), odir);
#undef convert #undef convert
return Py_BuildValue("(OOOO)", ofile_env, ofile, odir_env, odir); if ((tup = PyTuple_New(4)) == NULL) {
goto error;
}
PyTuple_SET_ITEM(tup, 0, ofile_env);
PyTuple_SET_ITEM(tup, 1, ofile);
PyTuple_SET_ITEM(tup, 2, odir_env);
PyTuple_SET_ITEM(tup, 3, odir);
return tup;
error: error:
Py_XDECREF(ofile_env); Py_XDECREF(ofile_env);