summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-libs/librdkafka/files/librdkafka-0.11.3-fix-memory-leak-issue1534.patch19
-rw-r--r--dev-libs/librdkafka/librdkafka-0.11.3-r1.ebuild (renamed from dev-libs/librdkafka/librdkafka-0.11.3.ebuild)2
2 files changed, 21 insertions, 0 deletions
diff --git a/dev-libs/librdkafka/files/librdkafka-0.11.3-fix-memory-leak-issue1534.patch b/dev-libs/librdkafka/files/librdkafka-0.11.3-fix-memory-leak-issue1534.patch
new file mode 100644
index 000000000000..ae4c3e5bc81e
--- /dev/null
+++ b/dev-libs/librdkafka/files/librdkafka-0.11.3-fix-memory-leak-issue1534.patch
@@ -0,0 +1,19 @@
+https://github.com/edenhill/librdkafka/commit/8fed971043e642c195860cd77006622d23616c22
+
+--- a/src/rdkafka_msgset_writer.c
++++ b/src/rdkafka_msgset_writer.c
+@@ -436,10 +436,12 @@ rd_kafka_msgset_writer_write_msg_payload (rd_kafka_msgset_writer_t *msetw,
+ * room in the buffer we'll copy the payload to the buffer,
+ * otherwise we push a reference to the memory. */
+ if (rkm->rkm_len <= (size_t)rk->rk_conf.msg_copy_max_size &&
+- rd_buf_write_remains(&rkbuf->rkbuf_buf) > rkm->rkm_len)
++ rd_buf_write_remains(&rkbuf->rkbuf_buf) > rkm->rkm_len) {
+ rd_kafka_buf_write(rkbuf,
+ rkm->rkm_payload, rkm->rkm_len);
+- else
++ if (free_cb)
++ free_cb(rkm->rkm_payload);
++ } else
+ rd_kafka_buf_push(rkbuf, rkm->rkm_payload, rkm->rkm_len,
+ free_cb);
+ }
diff --git a/dev-libs/librdkafka/librdkafka-0.11.3.ebuild b/dev-libs/librdkafka/librdkafka-0.11.3-r1.ebuild
index 00872b0eadc7..f7ec851be536 100644
--- a/dev-libs/librdkafka/librdkafka-0.11.3.ebuild
+++ b/dev-libs/librdkafka/librdkafka-0.11.3-r1.ebuild
@@ -15,6 +15,8 @@ if [[ ${PV} == "9999" ]]; then
else
SRC_URI="https://github.com/edenhill/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc x86"
+
+ PATCHES=( "${FILESDIR}"/${P}-fix-memory-leak-issue1534.patch )
fi
LICENSE="BSD-2"