diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index 6d3c340a8af..0f90f08b9cc 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -627,7 +627,6 @@ static const gpr_uint8 inverse_base64[256] = { static int on_hdr(grpc_chttp2_hpack_parser *p, grpc_mdelem *md, int add_to_table) { if (add_to_table) { - GRPC_MDELEM_REF(md); if (!grpc_chttp2_hptbl_add(&p->table, md)) { return 0; } diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c index e47793f2300..e7cec99be1b 100644 --- a/src/core/transport/chttp2/hpack_table.c +++ b/src/core/transport/chttp2/hpack_table.c @@ -316,7 +316,7 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) { } /* copy the finalized entry in */ - tbl->ents[tbl->last_ent] = md; + tbl->ents[tbl->last_ent] = GRPC_MDELEM_REF(md); /* update accounting values */ tbl->last_ent =