From: Matus Fabian Date: Fri, 27 Jun 2025 11:40:51 +0000 (+0200) Subject: http: fix http header table hash keys leak X-Git-Tag: v26.02-rc0~196 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F43337%2F2;p=vpp.git http: fix http header table hash keys leak Type: fix Change-Id: I60ebf767a1f96a1290b7738d6859241739ce452c Signed-off-by: Matus Fabian --- diff --git a/src/plugins/http/http.h b/src/plugins/http/http.h index 95b2faf062f..5777bd520a5 100644 --- a/src/plugins/http/http.h +++ b/src/plugins/http/http.h @@ -723,11 +723,16 @@ always_inline void http_reset_header_table (http_header_table_t *ht) { int i; + hash_pair_t *p; for (i = 0; i < vec_len (ht->concatenated_values); i++) vec_free (ht->concatenated_values[i]); vec_reset_length (ht->concatenated_values); vec_reset_length (ht->values); vec_reset_length (ht->buf); + hash_foreach_pair (p, ht->value_by_name, ({ + void *k = uword_to_pointer (p->key, void *); + clib_mem_free (k); + })); hash_free (ht->value_by_name); } @@ -751,11 +756,16 @@ always_inline void http_free_header_table (http_header_table_t *ht) { int i; + hash_pair_t *p; for (i = 0; i < vec_len (ht->concatenated_values); i++) vec_free (ht->concatenated_values[i]); vec_free (ht->concatenated_values); vec_free (ht->values); vec_free (ht->buf); + hash_foreach_pair (p, ht->value_by_name, ({ + void *k = uword_to_pointer (p->key, void *); + clib_mem_free (k); + })); hash_free (ht->value_by_name); }