@@ -1081,7 +1081,7 @@ l_ldap_result4(LDAPObject *self, PyObject *args)
1081
1081
struct timeval * tvp ;
1082
1082
int res_type ;
1083
1083
LDAPMessage * msg = NULL ;
1084
- PyObject * result_str , * retval , * pmsg , * pyctrls = 0 ;
1084
+ PyObject * retval , * pmsg , * pyctrls = 0 ;
1085
1085
int res_msgid = 0 ;
1086
1086
char * retoid = 0 ;
1087
1087
PyObject * valuestr = NULL ;
@@ -1191,27 +1191,19 @@ l_ldap_result4(LDAPObject *self, PyObject *args)
1191
1191
pmsg =
1192
1192
LDAPmessage_to_python (self -> ldap , msg , add_ctrls , add_intermediates );
1193
1193
1194
- if (res_type == 0 ) {
1195
- result_str = Py_None ;
1196
- Py_INCREF (Py_None );
1197
- }
1198
- else {
1199
- result_str = PyInt_FromLong (res_type );
1200
- }
1201
-
1202
1194
if (pmsg == NULL ) {
1203
1195
retval = NULL ;
1204
1196
}
1205
1197
else {
1206
1198
/* s handles NULL, but O does not */
1207
1199
if (add_extop ) {
1208
- retval = Py_BuildValue ("(OOiOsO )" , result_str , pmsg , res_msgid ,
1200
+ retval = Py_BuildValue ("(iOiOsO )" , res_type , pmsg , res_msgid ,
1209
1201
pyctrls , retoid ,
1210
1202
valuestr ? valuestr : Py_None );
1211
1203
}
1212
1204
else {
1213
1205
retval =
1214
- Py_BuildValue ("(OOiO )" , result_str , pmsg , res_msgid , pyctrls );
1206
+ Py_BuildValue ("(iOiO )" , res_type , pmsg , res_msgid , pyctrls );
1215
1207
}
1216
1208
1217
1209
if (pmsg != Py_None ) {
@@ -1220,7 +1212,6 @@ l_ldap_result4(LDAPObject *self, PyObject *args)
1220
1212
}
1221
1213
Py_XDECREF (valuestr );
1222
1214
Py_XDECREF (pyctrls );
1223
- Py_DECREF (result_str );
1224
1215
return retval ;
1225
1216
}
1226
1217
0 commit comments