aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-02-27 17:32:24 +0100
committerAnders Broman <a.broman58@gmail.com>2018-02-28 12:03:07 +0000
commitb8101ed9a905460050d5dfc1ad03e2af6c24fea2 (patch)
treee3a1cd7207e7aae6e8c8a89a18064dd00e72d4dd
parent2db0957d49df502b556adf99c88fcaba646ec165 (diff)
rrc: move allocation within if statement.
Change-Id: I2282a834560ef81a4f974e80fd6a0286e83a5461 Reviewed-on: https://code.wireshark.org/review/26143 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/asn1/rrc/rrc.cnf8
-rw-r--r--epan/dissectors/packet-rrc.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/asn1/rrc/rrc.cnf b/epan/dissectors/asn1/rrc/rrc.cnf
index eeac5e5bf2..a49755bac8 100644
--- a/epan/dissectors/asn1/rrc/rrc.cnf
+++ b/epan/dissectors/asn1/rrc/rrc.cnf
@@ -1358,12 +1358,12 @@ if(state_dec >= 0 && state_dec <= 3) {
private_data_set_ciphering_info(actx, ciphering_info);
/*Retrieve and store the value*/
- start = g_new(guint32,1);
- *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
- if(ciphering_info && ciphering_info->start_ps)
+ if(ciphering_info && ciphering_info->start_ps) {
+ start = g_new(guint32,1);
+ *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
/*Insert the value based on current frame num since this might vary over time*/
g_tree_insert(ciphering_info->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
-
+ }
break;
default:
break;
diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c
index 207411d949..5c46591a96 100644
--- a/epan/dissectors/packet-rrc.c
+++ b/epan/dissectors/packet-rrc.c
@@ -99976,12 +99976,12 @@ dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
private_data_set_ciphering_info(actx, ciphering_info);
/*Retrieve and store the value*/
- start = g_new(guint32,1);
- *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
- if(ciphering_info && ciphering_info->start_ps)
+ if(ciphering_info && ciphering_info->start_ps) {
+ start = g_new(guint32,1);
+ *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
/*Insert the value based on current frame num since this might vary over time*/
g_tree_insert(ciphering_info->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
-
+ }
break;
default:
break;