aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-nwk-gp.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-06-28 13:18:58 -0700
committerMichael Mann <mmann78@netscape.net>2015-07-03 23:37:18 +0000
commitea46cf4f73c72bf343a5d07ba33166d696a3d1f6 (patch)
tree72b7ea5bc05e06dcd526ec3b170604bffd2a62f5 /epan/dissectors/packet-zbee-nwk-gp.c
parent7ce77c69ea4f3424616558729ec23cf3dd1de694 (diff)
Split init of misc dissectors into init/cleanup functions
Convert remaining dissectors to use cleanup routines when possible. (Single-)linked lists require NULL, so do reset their pointers to NULL. Generated with https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=69af86e6c2cf965ba3d7f9636b647b195f0b7d57 (with AUDIT = ALWAYS_EMIT_CLEANUP_CODE = True) Remaining dissectors which did not need further changes: epan/dissectors/packet-aeron.c epan/dissectors/packet-bootp.c epan/dissectors/packet-brdwlk.c epan/dissectors/packet-drda.c epan/dissectors/packet-etch.c epan/dissectors/packet-fix.c epan/dissectors/packet-fw1.c epan/dissectors/packet-lbm.c epan/dissectors/packet-ldss.c epan/dissectors/packet-simulcrypt.c epan/dissectors/packet-spdy.c epan/dissectors/packet-starteam.c epan/dissectors/packet-udp.c Change-Id: Idcacfea6a5de38d40e67db4cdcd0452ad9f9a6a9 Reviewed-on: https://code.wireshark.org/review/9228 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk-gp.c')
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index d3291333cf..b155f73715 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -1453,10 +1453,6 @@ gp_init_zbee_security(void)
guint i;
key_record_t key_record;
- if (zbee_gp_keyring) {
- g_slist_free(zbee_gp_keyring);
- zbee_gp_keyring = NULL;
- }
for (i = 0; gp_uat_key_records && (i < num_uat_key_records); i++) {
key_record.frame_num = 0;
key_record.label = g_strdup(gp_uat_key_records[i].label);
@@ -1465,6 +1461,15 @@ gp_init_zbee_security(void)
}
}
+static void
+gp_cleanup_zbee_security(void)
+{
+ if (zbee_gp_keyring) {
+ g_slist_free(zbee_gp_keyring);
+ zbee_gp_keyring = NULL;
+ }
+}
+
/*FUNCTION:------------------------------------------------------
* NAME
* proto_register_zbee_nwk_gp
@@ -1755,6 +1760,7 @@ proto_register_zbee_nwk_gp(void)
"Pre-configured GP Security Keys.", zbee_gp_sec_key_table_uat);
register_init_routine(gp_init_zbee_security);
+ register_cleanup_routine(gp_cleanup_zbee_security);
/* Register the Wireshark protocol. */
proto_register_field_array(proto_zbee_nwk_gp, hf, array_length(hf));