[h5py] 284/455: Fix premature decref of temp string
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:42 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 3b5c85a1aa4ba216eeb9a3cb3179535d49edc1fb
Author: andrewcollette <andrew.collette at gmail.com>
Date: Wed Jun 17 22:13:04 2009 +0000
Fix premature decref of temp string
---
h5py/typeconv.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/h5py/typeconv.c b/h5py/typeconv.c
index df67079..f9af6e2 100644
--- a/h5py/typeconv.c
+++ b/h5py/typeconv.c
@@ -224,7 +224,6 @@ herr_t str_to_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
if(inter_string == NULL) goto conv_failed;
len = PyString_Size(inter_string)+1;
str_tmp = PyString_AsString(inter_string);
- Py_DECREF(inter_string);
}
}
@@ -234,12 +233,18 @@ herr_t str_to_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
}
+ retval = 0;
+
+ conv_out:
+
+ /* Note we do NOT decref obj, as it is a borrowed reference */
+ Py_XDECREF(inter_string);
PyGILState_Release(gil);
- return 0;
+ return retval;
conv_failed: /* Error target */
- PyGILState_Release(gil);
- return -1;
+ retval = -1;
+ goto conv_out;
case H5T_CONV_FREE:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list