File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,9 @@ struct aws_hpack_context *aws_hpack_context_new(struct aws_allocator *allocator,
279
279
/* Initialize dynamic table */
280
280
if (max_dynamic_elements ) {
281
281
context -> dynamic_table .buffer = aws_mem_calloc (allocator , max_dynamic_elements , sizeof (struct aws_http_header ));
282
+ if (!context -> dynamic_table .buffer ) {
283
+ goto dynamic_table_buffer_failed ;
284
+ }
282
285
}
283
286
context -> dynamic_table .max_elements = max_dynamic_elements ;
284
287
context -> dynamic_table .num_elements = 0 ;
@@ -315,6 +318,8 @@ struct aws_hpack_context *aws_hpack_context_new(struct aws_allocator *allocator,
315
318
if (context -> dynamic_table .buffer ) {
316
319
aws_mem_release (allocator , context -> dynamic_table .buffer );
317
320
}
321
+
322
+ dynamic_table_buffer_failed :
318
323
aws_mem_release (allocator , context );
319
324
320
325
return NULL ;
You can’t perform that action at this time.
0 commit comments