Fix resource leak

This commit is contained in:
Tatsuhiro Tsujikawa 2013-09-07 01:45:54 +09:00
parent 4dcf9ad4f2
commit 4db8338012
1 changed files with 2 additions and 0 deletions

View File

@ -622,6 +622,7 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context,
NGHTTP2_HD_FLAG_VALUE_ALLOC, NGHTTP2_HD_FLAG_VALUE_ALLOC,
nv->name, nv->namelen, nv->value, nv->valuelen); nv->name, nv->namelen, nv->value, nv->valuelen);
if(rv != 0) { if(rv != 0) {
free(new_ent);
return NULL; return NULL;
} }
if(room > NGHTTP2_HD_MAX_BUFFER_SIZE) { if(room > NGHTTP2_HD_MAX_BUFFER_SIZE) {
@ -709,6 +710,7 @@ static nghttp2_hd_entry* add_hd_table_subst(nghttp2_hd_context *context,
NGHTTP2_HD_FLAG_VALUE_ALLOC, NGHTTP2_HD_FLAG_VALUE_ALLOC,
nv->name, nv->namelen, nv->value, nv->valuelen); nv->name, nv->namelen, nv->value, nv->valuelen);
if(rv != 0) { if(rv != 0) {
free(new_ent);
return NULL; return NULL;
} }
if(room > NGHTTP2_HD_MAX_BUFFER_SIZE) { if(room > NGHTTP2_HD_MAX_BUFFER_SIZE) {