| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Every Python API call requires an explicit error check.
Please also include documentation update and test cases.
Sorry, something went wrong.
|
|
||
| if (errnum == LDAP_REFERRAL && refs != NULL && refs[0] != NULL) { | ||
| /* Return all referrals as a list in "reflist" */ | ||
| PyObject *referralList = PyList_New(0); |
There was a problem hiding this comment.
Missing error check.
Sorry, something went wrong.
| PyObject *referralList = PyList_New(0); | ||
| int i = 0; | ||
| while (refs[i] != NULL) { | ||
| PyObject *referralURL = Py_BuildValue("s", refs[i++]); |
There was a problem hiding this comment.
Use PyUnicode_FromString() and check for error (NULL).
Sorry, something went wrong.
| int i = 0; | ||
| while (refs[i] != NULL) { | ||
| PyObject *referralURL = Py_BuildValue("s", refs[i++]); | ||
| PyList_Append(referralList, referralURL); |
There was a problem hiding this comment.
Missing error check.
Sorry, something went wrong.
| PyList_Append(referralList, referralURL); | ||
| Py_XDECREF(referralURL); | ||
| } | ||
| PyDict_SetItemString(info, "reflist", referralList); |
There was a problem hiding this comment.
Missing error check
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Added a refList that contains all referrals returned from the server.
Still maintains the first referral in 'info'.