[Python-Dev] remaining issues from Klocwork static analysis (original) (raw)
Georg Brandl g.brandl at gmx.net
Tue Jul 25 11:57:23 CEST 2006
- Previous message: [Python-Dev] remaining issues from Klocwork static analysis
- Next message: [Python-Dev] remaining issues from Klocwork static analysis
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Martin v. Löwis wrote:
Neal Norwitz wrote:
# 74 Object/funcobject.c:143 Suspicious deref of ptr before NULL check Not quite sure what it is complaining about, but else if (PyTupleCheck(closure)) { PyXINCREF(closure); } looks indeed suspicious: Why do we check for NULL (XINCREF) when we know closure can't be NULL (TupleCheck). Drop the X, and see if the warning goes away
In comparison, the PyFunction_SetDefaults function does check for NULL, and raises an error in this case. However, since it is a C API function only, passing NULL is an error anyway.
Georg
- Previous message: [Python-Dev] remaining issues from Klocwork static analysis
- Next message: [Python-Dev] remaining issues from Klocwork static analysis
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]