Skip to content
Permalink
Browse files

genhufdec: Free top table before exit

  • Loading branch information...
fwsGonzo authored and Dridi committed Oct 9, 2019
1 parent 5f039a4 commit a791188e2e8b7782d81d93b465f32cf53e0509f9
Showing with 11 additions and 0 deletions.
  1. +11 −0 bin/varnishd/hpack/vhp_gen_hufdec.c
@@ -92,6 +92,16 @@ tbl_new(unsigned mask)
return (tbl);
}

static void
tbl_free(struct tbl* table)
{
for (unsigned i = 0; i < table->n; i++) {
if (table->e[i].next != NULL)
tbl_free(table->e[i].next);
}
free(table);
}

static void
tbl_add(struct tbl *tbl, uint32_t code, unsigned codelen,
uint32_t bits, unsigned len, char chr)
@@ -250,5 +260,6 @@ main(int argc, const char **argv)
tbl_print(top);
printf("};\n");

tbl_free(top);
return (0);
}

0 comments on commit a791188

Please sign in to comment.
You can’t perform that action at this time.