forked from osmocom/wireshark
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`.
This commit is contained in:
parent
cd2d35c1d2
commit
969c1c0271
|
@ -1377,7 +1377,7 @@ if(state_dec >= 0 && state_dec <= 3) {
|
||||||
/*If it doesn't exists, insert it*/
|
/*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 ){
|
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*/
|
*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);
|
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 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 ){
|
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*/
|
*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);
|
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");
|
col_append_str(actx->pinfo->cinfo, COL_INFO, "Scheduling Block 3");
|
||||||
%(DEFAULT_BODY)s
|
%(DEFAULT_BODY)s
|
||||||
|
|
||||||
#.END
|
#.END
|
||||||
|
|
|
@ -46484,7 +46484,7 @@ dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_c
|
||||||
/*If it doesn't exists, insert it*/
|
/*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 ){
|
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*/
|
*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);
|
g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p);
|
||||||
|
|
||||||
|
@ -49959,7 +49959,7 @@ dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_c
|
||||||
/*If it doesn't exists, insert it*/
|
/*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 ){
|
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*/
|
*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);
|
g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((guint)rrcinf->hrnti[actx->pinfo->fd->subnum]), flowd_p);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue