File: Modules/LDAPObject.c
Function: interaction
Error: ob_refcnt of '*result' is 1 too high
551 */
552 static int interaction ( unsigned flags, 
553                          sasl_interact_t *interact,
554                          PyObject* SASLObject )
555 {
556 /*  const char *dflt = interact->defresult; */
557   PyObject *result;
558   char *c_result;
559   result = PyObject_CallMethod(SASLObject,
when treating unknown struct sasl_interact_t * from Modules/LDAPObject.c:553 as non-NULL
when _PyObject_CallMethod_SizeT() succeeds
new ref from call to _PyObject_CallMethod_SizeT allocated at:   result = PyObject_CallMethod(SASLObject,
ob_refcnt is now refs: 1 + N where N >= 0
560                                "callback",
561                                "isss",
562                                interact->id,  /* see sasl.h */
563                                interact->challenge,
564                                interact->prompt,   
565                                interact->defresult);
566 
567   if (result == NULL) 
taking False path
568     /*searching for a better error code */
569     return LDAP_OPERATIONS_ERROR; 
570   c_result = PyString_AsString(result); /*xxx Error checking?? */
when PyString_AsString() succeeds
571   
572   /* according to the sasl docs, we should malloc() the returned
573      string only for calls where interact->id == SASL_CB_PASS, so we
574      probably leak a few bytes per ldap bind. However, if I restrict
575      the strdup() to this case, I get segfaults. Should probably be
576      fixed sometimes.
577   */
578   interact->result = strdup( c_result );
579   if (interact->result == NULL)
when treating unknown char * from Modules/LDAPObject.c:578 as NULL
taking True path
580     return LDAP_OPERATIONS_ERROR;
581   interact->len = strlen(c_result);
582   /* We _should_ overwrite the python string buffer for security
583      reasons, however we may not (api/stringObjects.html). Any ideas?
584   */
585   
586   Py_DECREF(result); /*not needed any longer */
587   result = NULL;
588   
589   return LDAP_SUCCESS;
590 }
ob_refcnt of '*result' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 1 similar trace(s) to this