Skip to content

Commit

Permalink
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.
  • Loading branch information
edenhill committed Aug 20, 2020
1 parent a2c0a46 commit c120b4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rdkafka_topic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c120b4c

Please sign in to comment.