diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-07-15 16:50:32 +0200 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-07-15 22:56:49 +0000 |
commit | aebce0b6ecf815e9bef52f6b52d5f2a12a116e1d (patch) | |
tree | a7cfb2ad2c554f2b4e05c0df311eef97d2af8344 /epan/nghttp2 | |
parent | 91f627b7e73e5679872bc147bc0aac19c83a4ea1 (diff) | |
download | wireshark-aebce0b6ecf815e9bef52f6b52d5f2a12a116e1d.tar.gz |
HTTP2: Fix double free
Found by Clang Analyzer
Backport from https://github.com/tatsuhiro-t/nghttp2/commit/62423f5949001c375c8e325296c74c92d1be0965
Signed-off-by: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Change-Id: Ic70f74b55ab80ca0b8d5042f07a29c9d14af4fe2
Reviewed-on: https://code.wireshark.org/review/3058
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/nghttp2')
-rw-r--r-- | epan/nghttp2/nghttp2_hd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/nghttp2/nghttp2_hd.c b/epan/nghttp2/nghttp2_hd.c index 9bf140ec02..75410c73fb 100644 --- a/epan/nghttp2/nghttp2_hd.c +++ b/epan/nghttp2/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); |