summaryrefslogtreecommitdiff
path: root/epan/column.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2014-11-05 14:36:29 +0100
committerAnders Broman <a.broman58@gmail.com>2014-11-10 08:00:56 +0000
commitd58567bd78abc1903191c9a955365b8d41f09496 (patch)
tree7d273d1e1cbd98e8bc3ead53906e62dbc0378b3e /epan/column.c
parent64b8759fbbdd3495ea7a7a70c7436a7f56227be1 (diff)
downloadwireshark-d58567bd78abc1903191c9a955365b8d41f09496.tar.gz
Fixed memory leakage in col_cleanup.
Several fields in cinfo is allocated memory and must be freed here to avoid memory leakage when recreating the packet list. Do not allocate memory for col_expr[] as this points to static strings or other allocated strings. Change-Id: I840377e3c590b1a3e2a38e0537465a028041d1e9 Reviewed-on: https://code.wireshark.org/review/5137 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/column.c')
-rw-r--r--epan/column.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/column.c b/epan/column.c
index 24a35f5084..c5aacd9777 100644
--- a/epan/column.c
+++ b/epan/column.c
@@ -824,7 +824,7 @@ build_column_format_array(column_info *cinfo, const gint num_cols, const gboolea
if(reset_fences)
cinfo->col_fence[i] = 0;
- cinfo->col_expr.col_expr[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
+ cinfo->col_expr.col_expr[i] = "";
cinfo->col_expr.col_expr_val[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
}