Example #1
0
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	g_slist_free(edt->pi.proto_data);
	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	if (edt->tvb) {
		/* Free all tvb's chained from this tvb */
		tvb_free_chain(edt->tvb);
	}

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}

	if (pinfo_pool_cache == NULL) {
		wmem_free_all(edt->pi.pool);
		pinfo_pool_cache = edt->pi.pool;
	}
	else {
		wmem_destroy_allocator(edt->pi.pool);
	}
}
Example #2
0
void
epan_dissect_reset(epan_dissect_t *edt)
{
	/* We have to preserve the pool pointer across the memzeroing */
	wmem_allocator_t *tmp;

	g_assert(edt);

	g_slist_free(edt->pi.proto_data);
	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	if (edt->tvb) {
		/* Free all tvb's chained from this tvb */
		tvb_free_chain(edt->tvb);
		edt->tvb = NULL;
	}

	if (edt->tree)
		proto_tree_reset(edt->tree);

	tmp = edt->pi.pool;
	wmem_free_all(tmp);

	memset(&edt->pi, 0, sizeof(edt->pi));
	edt->pi.pool = tmp;
}
Example #3
0
static void
value_free(fvalue_t *fv)
{
	if (fv->value.tvb && fv->tvb_is_private) {
		tvb_free_chain(fv->value.tvb);
	}
}
Example #4
0
static void
mime_encap_init(void)
{
    if (file_tvbs) {
        tvb_free_chain(file_tvbs);
        file_tvbs = NULL;
        whole_tvb = NULL;
    }
}
Example #5
0
void
epan_dissect_reset(epan_dissect_t *edt)
{
	/* epan_dissect_cleanup(edt) without freeing tree */
	g_slist_free(edt->pi.dependent_frames);
	free_data_sources(&edt->pi);
	tvb_free_chain(edt->tvb);

	/* epan_dissect_init(edt, create_proto, visible_proto) */
	edt->pi.dependent_frames = NULL;
	if (edt->tree)
		proto_tree_reset(edt->tree);
}
Example #6
0
/* APB: from wireshark-1.4.0/epan/epan.c, backported for wireshark pre-1.4.0 support */
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	/* Free all tvb's created from this tvb, unless dissector
	 * wanted to store the pointer (in which case, the dissector
	 * would have incremented the usage count on that tvbuff_t*) */
	tvb_free_chain(edt->tvb);

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}
}
Example #7
0
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	/* Free all tvb's chained from this tvb */
	tvb_free_chain(edt->tvb);

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}
}