Fix memory leak

pull/4097/head
Craig Tiller 9 years ago
parent 308bbb2c4b
commit 895f14d381
  1. 1
      src/core/transport/chttp2/hpack_parser.c
  2. 2
      src/core/transport/chttp2/hpack_table.c

@ -627,7 +627,6 @@ static const gpr_uint8 inverse_base64[256] = {
static int on_hdr(grpc_chttp2_hpack_parser *p, grpc_mdelem *md, static int on_hdr(grpc_chttp2_hpack_parser *p, grpc_mdelem *md,
int add_to_table) { int add_to_table) {
if (add_to_table) { if (add_to_table) {
GRPC_MDELEM_REF(md);
if (!grpc_chttp2_hptbl_add(&p->table, md)) { if (!grpc_chttp2_hptbl_add(&p->table, md)) {
return 0; return 0;
} }

@ -316,7 +316,7 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) {
} }
/* copy the finalized entry in */ /* copy the finalized entry in */
tbl->ents[tbl->last_ent] = md; tbl->ents[tbl->last_ent] = GRPC_MDELEM_REF(md);
/* update accounting values */ /* update accounting values */
tbl->last_ent = tbl->last_ent =

Loading…
Cancel
Save