wslua: do not free TVB for data sources

Bug: 12050
Change-Id: If094f78f683776ba2ea3ddd848ec9018cba064b8
Reviewed-on: https://code.wireshark.org/review/13554
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Peter Wu 2016-01-26 18:38:41 +01:00 committed by Alexis La Goutte
parent f96c56103b
commit 884795e60f
1 changed files with 2 additions and 2 deletions

View File

@ -355,9 +355,9 @@ WSLUA_CONSTRUCTOR ByteArray_tvb (lua_State *L) {
data = (guint8 *)g_memdup(ba->data, ba->len);
tvb = (Tvb)g_malloc(sizeof(struct _wslua_tvb));
tvb->ws_tvb = tvb_new_real_data(data, ba->len,ba->len);
tvb->ws_tvb = tvb_new_child_real_data(lua_tvb, data, ba->len,ba->len);
tvb->expired = FALSE;
tvb->need_free = TRUE;
tvb->need_free = FALSE;
tvb_set_free_cb(tvb->ws_tvb, g_free);
add_new_data_source(lua_pinfo, tvb->ws_tvb, name);