aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/rrc/rrc.cnf
diff options
context:
space:
mode:
authorMoshe Kaplan <me@moshekaplan.com>2020-12-26 21:54:52 -0500
committerAndersBroman <a.broman58@gmail.com>2020-12-27 14:11:37 +0000
commit969c1c0271bf71cb14ea2a9658c844891f937f84 (patch)
tree656fed7fd14895baf74a0a8f49735d9d384b2ef3 /epan/dissectors/asn1/rrc/rrc.cnf
parentcd2d35c1d2b10fe2916469544cc2951a8979a4dc (diff)
packet-rrc: allocate correct type of object
When creating a `flowd_p`, instead of allocating space for a `gint`, allocate space for a `guint`, which is the actual type of object used. Also, switch from `g_malloc` to `g_new`.
Diffstat (limited to 'epan/dissectors/asn1/rrc/rrc.cnf')
-rw-r--r--epan/dissectors/asn1/rrc/rrc.cnf6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/asn1/rrc/rrc.cnf b/epan/dissectors/asn1/rrc/rrc.cnf
index 927b5c04a7..2a3d6d170f 100644
--- a/epan/dissectors/asn1/rrc/rrc.cnf
+++ b/epan/dissectors/asn1/rrc/rrc.cnf
@@ -1377,7 +1377,7 @@ if(state_dec >= 0 && state_dec <= 3) {
/*If it doesn't exists, insert it*/
if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
- flowd_p = (guint*)g_malloc0(sizeof(gint));
+ flowd_p = g_new0(guint, 1);
*flowd_p = (1U<<flowd); /*Set the bit to mark it as true*/
g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p);
@@ -1413,7 +1413,7 @@ if(state_dec >= 0 && state_dec <= 3) {
/*If it doesn't exists, insert it*/
if( (cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]))) == NULL ){
- flowd_p = (guint*)g_malloc0(sizeof(gint));
+ flowd_p = g_new0(guint, 1);
*flowd_p = (1U<<flowd); /* Set the bit to mark it as true*/
g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p);
@@ -1740,4 +1740,4 @@ private_data_set_rlc_ciphering_sqn(actx, rlc_ciphering_sqn);
col_append_str(actx->pinfo->cinfo, COL_INFO, "Scheduling Block 3");
%(DEFAULT_BODY)s
-#.END \ No newline at end of file
+#.END