[pygobject/gsoc2009: 131/160] Avoid using non-initialized pointers
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 131/160] Avoid using non-initialized pointers
- Date: Fri, 14 Aug 2009 21:34:45 +0000 (UTC)
commit 740d691d351e9e90c7d41c039d38930df56019d7
Author: Simon van der Linden <svdlinden src gnome org>
Date: Tue Aug 11 17:20:55 2009 +0200
Avoid using non-initialized pointers
gi/pygi-argument.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index e4f12a8..8145109 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -114,8 +114,6 @@ _pygi_gi_type_tag_py_bounds (GITypeTag type_tag,
PyObject **lower,
PyObject **upper)
{
- *lower = *upper = NULL;
-
switch(type_tag) {
case GI_TYPE_TAG_INT8:
*lower = PyInt_FromLong(-128);
@@ -188,6 +186,7 @@ _pygi_gi_type_tag_py_bounds (GITypeTag type_tag,
break;
default:
PyErr_SetString(PyExc_TypeError, "Non-numeric type tag");
+ *lower = *upper = NULL;
return;
}
}
@@ -308,11 +307,12 @@ _pygi_g_type_info_check_object (GITypeInfo *type_info,
/* Check bounds */
if (PyObject_Compare(lower, object) > 0
|| PyObject_Compare(upper, object) < 0) {
- PyObject *lower_str, *upper_str;
+ PyObject *lower_str;
+ PyObject *upper_str;
if (PyErr_Occurred()) {
retval = -1;
- goto check_number_error_release;
+ goto check_number_release;
}
lower_str = PyObject_Str(lower);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]