-
Notifications
You must be signed in to change notification settings - Fork 919
Closed
Labels
bugReporting an unexpected or problematic behavior of the codebaseReporting an unexpected or problematic behavior of the codebase
Milestone
Description
In confluent_kafka.h
this function has the following definition: #define cfl_PyUnistr_AsUTF8(X) PyBytes_AsString(PyUnicode_AsUTF8String(X))
The problems is that PyUnicode_AsUTF8String
returns a new reference which is never released via Py_DECREF
later on. Which means the return value of PyUnicode_AsUTF8String
leaks memory.
I know a proper fix is hard, because the Py_DECREF
must be deferred to the point where the result of PyUnicode_AsUTF8String
is not used any more (considering also error cases ..).
I did not have problems with this leak yet, because the places where it happens are not triggered often in my code. However as soon as this is called frequently, for example TopicPartition_str0
with an errstr
set, it will have an impact.
Metadata
Metadata
Assignees
Labels
bugReporting an unexpected or problematic behavior of the codebaseReporting an unexpected or problematic behavior of the codebase