LDAP: Improved a if-check to avoid a analyzis warning.
authorStig Bjørlykke <stig@bjorlykke.org>
Wed, 15 Oct 2014 09:58:40 +0000 (11:58 +0200)
committerStig Bjørlykke <stig@bjorlykke.org>
Wed, 15 Oct 2014 10:53:59 +0000 (10:53 +0000)
Change-Id: Iceeaa94a80543570a720281ac39d3ccd9ac924fa
Reviewed-on: https://code.wireshark.org/review/4699
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
asn1/ldap/packet-ldap-template.c
epan/dissectors/packet-ldap.c

index 044143418c39301e6a7c5b5d844c437a8f7c2cd0..e5a93519e0b36cf6d08e3c1f2e0860df055ec3d4 100644 (file)
@@ -492,7 +492,7 @@ attribute_types_initialize_cb(void)
   guint i;
   gchar* attribute_type;
 
-  if (attribute_types_hash) {
+  if (attribute_types_hash && hf) {
     guint hf_size = g_hash_table_size (attribute_types_hash);
     /* Unregister all fields */
     for (i = 0; i < hf_size; i++) {
index 4d38bf3f1b27e1ef67dda99c68e127d90f3b454a..7d28a2b30d72e30db22b82e1ad1c9e3fa0ffc917 100644 (file)
@@ -706,7 +706,7 @@ attribute_types_initialize_cb(void)
   guint i;
   gchar* attribute_type;
 
-  if (attribute_types_hash) {
+  if (attribute_types_hash && hf) {
     guint hf_size = g_hash_table_size (attribute_types_hash);
     /* Unregister all fields */
     for (i = 0; i < hf_size; i++) {