X Tutup
Skip to content

Fix multiple ref leaks when raising TypeError#31

Closed
tiran wants to merge 0 commit intopython-ldap:masterfrom
tiran:refleak_errcase
Closed

Fix multiple ref leaks when raising TypeError#31
tiran wants to merge 0 commit intopython-ldap:masterfrom
tiran:refleak_errcase

Conversation

@tiran
Copy link
Copy Markdown
Member

@tiran tiran commented Nov 27, 2017

Multiple functions had a reference leak while raising a TypeError with
Py_BuildValue(). The CAPI function Py_BuildValue() returns a new
reference. PyErr_SetObject() does NOT consume the reference. Instead it
increments the reference count of the object again.

A new function LDAPerror_TypeError() handles raising TypeError with
custom message and object.

Closes: #24
Signed-off-by: Christian Heimes cheimes@redhat.com

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2017

Codecov Report

Merging #31 into master will increase coverage by <.01%.
The diff coverage is 30.76%.

@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
+ Coverage   62.35%   62.35%   +<.01%     
==========================================
  Files          45       45              
  Lines        4362     4370       +8     
  Branches      735      737       +2     
==========================================
+ Hits         2720     2725       +5     
- Misses       1335     1337       +2     
- Partials      307      308       +1
Impacted Files Coverage Δ
Modules/ldapcontrol.c 50.59% <0%> (+0.29%) ⬆️
Modules/LDAPObject.c 54.26% <33.33%> (+0.16%) ⬆️
Modules/errors.c 76.64% <38.46%> (-2.73%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2b7faf...3ae3b6a. Read the comment docs.

@tiran tiran closed this Nov 27, 2017
@tiran tiran deleted the refleak_errcase branch December 5, 2017 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup