Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct internal topic object destructor to avoid C++ API crash (#…
Browse files Browse the repository at this point in the history
…2963)

.. for consumer errors that originate from light-weight topic objects.
edenhill committed Aug 25, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a2c0a46 commit 3c1a827
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# librdkafka v1.6.0

## Fixes

### General fixes

* `rd_kafka_topic_opaque()` (used by the C++ API) would cause object
refcounting issues when used on light-weight (error-only) topic objects
such as consumer errors (#2693)


# librdkafka v1.5.0

The v1.5.0 release brings usability improvements, enhancements and fixes to
6 changes: 4 additions & 2 deletions src/rdkafka_topic.c
Original file line number Diff line number Diff line change
@@ -119,7 +119,9 @@ void rd_kafka_topic_destroy_final (rd_kafka_topic_t *rkt) {
}

/**
* Application destroy
* @brief Application topic object destroy.
* @warning MUST ONLY BE CALLED BY THE APPLICATION.
* Use rd_kafka_topic_destroy0() for all internal use.
*/
void rd_kafka_topic_destroy (rd_kafka_topic_t *app_rkt) {
rd_kafka_lwtopic_t *lrkt;
@@ -1487,7 +1489,7 @@ void *rd_kafka_topic_opaque (const rd_kafka_topic_t *app_rkt) {

opaque = rkt->rkt_conf.opaque;

rd_kafka_topic_destroy(rkt); /* loose refcnt from find() */
rd_kafka_topic_destroy0(rkt); /* loose refcnt from find() */

return opaque;
}

0 comments on commit 3c1a827

Please sign in to comment.