From 62423f5949001c375c8e325296c74c92d1be0965 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 15 Jul 2014 22:47:04 +0900 Subject: [PATCH] Fix double free --- lib/nghttp2_hd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 78e7207f..5b380142 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -864,6 +864,13 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context, if(rv != 0) { --new_ent->ref; + + /* nv->name and nv->value are managed by caller. */ + new_ent->nv.name = NULL; + new_ent->nv.namelen = 0; + new_ent->nv.value = NULL; + new_ent->nv.valuelen = 0; + nghttp2_hd_entry_free(new_ent); free(new_ent);