@@ -73,25 +73,34 @@ result_init(getdns_ResultObject *self, getdns_dict *result_dict)
73
73
#else
74
74
self -> answer_type = PyInt_FromLong ((long )answer_type );
75
75
#endif
76
- if ((canonical_name = get_canonical_name (result_dict )) == 0 )
76
+ if ((canonical_name = get_canonical_name (result_dict )) == 0 ) {
77
77
self -> canonical_name = Py_None ;
78
- else
78
+ Py_INCREF (Py_None );
79
+ } else {
79
80
#if PY_MAJOR_VERSION >= 3
80
81
self -> canonical_name = PyUnicode_FromString (canonical_name );
81
82
#else
82
83
self -> canonical_name = PyString_FromString (canonical_name );
83
84
#endif
85
+ }
84
86
if ((self -> just_address_answers = get_just_address_answers (result_dict )) == NULL ) {
85
87
self -> just_address_answers = Py_None ;
88
+ Py_INCREF (Py_None );
86
89
}
87
- if ((self -> validation_chain = get_validation_chain (result_dict )) == NULL )
90
+ if ((self -> validation_chain = get_validation_chain (result_dict )) == NULL ) {
88
91
self -> validation_chain = Py_None ;
92
+ Py_INCREF (Py_None );
93
+ }
89
94
#if GETDNS_NUMERIC_VERSION < 0x00090000
90
- if ((self -> call_debugging = get_call_debugging (result_dict )) == NULL )
95
+ if ((self -> call_debugging = get_call_debugging (result_dict )) == NULL ) {
91
96
self -> call_debugging = Py_None ;
97
+ Py_INCREF (Py_None );
98
+ }
92
99
#else
93
- if ((self -> call_reporting = get_call_reporting (result_dict )) == NULL )
100
+ if ((self -> call_reporting = get_call_reporting (result_dict )) == NULL ) {
94
101
self -> call_reporting = Py_None ;
102
+ Py_INCREF (Py_None );
103
+ }
95
104
#endif
96
105
return 0 ;
97
106
}
@@ -105,16 +114,25 @@ result_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
105
114
self = (getdns_ResultObject * )type -> tp_alloc (type , 0 );
106
115
if (self != NULL ) {
107
116
self -> just_address_answers = Py_None ;
117
+ Py_INCREF (Py_None );
108
118
self -> answer_type = Py_None ;
119
+ Py_INCREF (Py_None );
109
120
self -> status = Py_None ;
121
+ Py_INCREF (Py_None );
110
122
self -> replies_tree = Py_None ;
123
+ Py_INCREF (Py_None );
111
124
self -> canonical_name = Py_None ;
125
+ Py_INCREF (Py_None );
112
126
self -> replies_full = Py_None ;
127
+ Py_INCREF (Py_None );
113
128
self -> validation_chain = Py_None ;
129
+ Py_INCREF (Py_None );
114
130
#if GETDNS_NUMERIC_VERSION < 0x00090000
115
131
self -> call_debugging = Py_None ;
132
+ Py_INCREF (Py_None );
116
133
#else
117
134
self -> call_reporting = Py_None ;
135
+ Py_INCREF (Py_None );
118
136
#endif
119
137
}
120
138
return (PyObject * )self ;
0 commit comments