Commit 6ec81c7
committed
Update reference counting
from Barry Warsaw:
- It's possible the code jumps to error: after pkgname is decref'd. I
think that decref should be deferred until just before the good-path
return.
- pkgname_or_unknown will be a new reference if pkgname is NULL, or it
will steal the pkgname reference if it's not. In either case, the error
stanza should decref pkgname_or_unknown, which will take care of
ensuring the object gets decref for any goto error path.
- pkgpath doesn't get decref'd. I think you should Py_XDECREF it before
the return NULL just in case pkgpath is itself NULL.1 parent a181463 commit 6ec81c7
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5009 | 5009 | | |
5010 | 5010 | | |
5011 | 5011 | | |
5012 | | - | |
5013 | 5012 | | |
5014 | 5013 | | |
5015 | 5014 | | |
| |||
5018 | 5017 | | |
5019 | 5018 | | |
5020 | 5019 | | |
| 5020 | + | |
5021 | 5021 | | |
5022 | 5022 | | |
5023 | 5023 | | |
| |||
5041 | 5041 | | |
5042 | 5042 | | |
5043 | 5043 | | |
| 5044 | + | |
| 5045 | + | |
5044 | 5046 | | |
5045 | 5047 | | |
5046 | 5048 | | |
| |||
0 commit comments