Add a very small hack to make the UAT update callback error string freeable, and
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Oct 2013 22:14:25 +0000 (22:14 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Oct 2013 22:14:25 +0000 (22:14 +0000)
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@52854 f5534014-38df-0310-8fa8-9805f1628bb7

22 files changed:
asn1/c1222/packet-c1222-template.c
asn1/ldap/packet-ldap-template.c
asn1/snmp/packet-snmp-template.c
epan/dfilter/dfilter-macro.c
epan/dissectors/packet-bootp.c
epan/dissectors/packet-c1222.c
epan/dissectors/packet-http.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-ieee802154.c
epan/dissectors/packet-imf.c
epan/dissectors/packet-isakmp.c
epan/dissectors/packet-k12.c
epan/dissectors/packet-ldap.c
epan/dissectors/packet-sccp.c
epan/dissectors/packet-snmp.c
epan/dissectors/packet-ssl.c
epan/dissectors/packet-vcdu.c
epan/dissectors/packet-zbee-security.c
epan/geoip_db.c
epan/uat_load.l
plugins/stats_tree/pinfo_stats_tree.c
ui/gtk/uat_gui.c

index 92b2b57883339ae5b36632608df4f29f51164dc2..022b255108a7f053941801038453ccb22af1868f 100644 (file)
@@ -673,7 +673,7 @@ static const TOP_ELEMENT_CONTROL canonifyTable[] = {
   { FALSE, FALSE, 0x0,  TRUE, NULL, NULL }
 };
 
-static void 
+static void
 clear_canon(void)
 {
   const TOP_ELEMENT_CONTROL *t = canonifyTable;
@@ -736,10 +736,10 @@ c1222_uat_data_update_cb(void* n, const char** err)
   c1222_uat_data_t* new_rec = (c1222_uat_data_t *)n;
 
   if (new_rec->keynum > 0xff) {
-    *err = "Invalid key number; must be less than 256";
+    *err = g_strdup("Invalid key number; must be less than 256");
   }
   if (new_rec->keylen != EAX_SIZEOF_KEY) {
-    *err = "Invalid key size; must be 16 bytes";
+    *err = g_strdup("Invalid key size; must be 16 bytes");
   }
 }
 
index ab5a6b78a2b592cde5946360f15ae7b8d92a61c2..33b32f31ad681ec6fe42bd89e751818320d299a7 100644 (file)
@@ -408,13 +408,13 @@ attribute_types_update_cb(void *r, const char **err)
   char c;
 
   if (rec->attribute_type == NULL) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+    *err = g_strdup("Attribute type can't be empty");
     return;
   }
 
   g_strstrip(rec->attribute_type);
   if (rec->attribute_type[0] == 0) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+    *err = g_strdup("Attribute type can't be empty");
     return;
   }
 
@@ -423,7 +423,7 @@ attribute_types_update_cb(void *r, const char **err)
    */
   c = proto_check_field_name(rec->attribute_type);
   if (c) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c);
+    *err = g_strdup_printf("Attribute type can't contain '%c'", c);
     return;
   }
 
index 54b2338d6967db2911796b9796f5d9e667468157..5e7456ed4f3c73e75437c6249d7682d6fd38d110 100644 (file)
@@ -2230,7 +2230,7 @@ static void
 snmp_users_update_cb(void* p _U_, const char** err)
 {
        snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p;
-       emem_strbuf_t* es = ep_strbuf_new("");
+       GString* es = g_string_new("");
        unsigned int i;
 
        *err = NULL;
@@ -2240,14 +2240,14 @@ snmp_users_update_cb(void* p _U_, const char** err)
                return;
 
        if (! ue->user.userName.len)
-               ep_strbuf_append_printf(es,"no userName\n");
+               g_string_append_printf(es,"no userName\n");
 
        for (i=0; i<num_ueas-1; i++) {
                snmp_ue_assoc_t* u = &(ueas[i]);
 
                /* RFC 3411 section 5 */
                if ((u->engine.len > 0) && (u->engine.len < 5 || u->engine.len > 32)) {
-                       ep_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len);
+                       g_string_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len);
                }
 
 
@@ -2257,21 +2257,21 @@ snmp_users_update_cb(void* p _U_, const char** err)
                        if (u->engine.len > 0 && memcmp( u->engine.data,   ue->engine.data,  u->engine.len ) == 0) {
                                if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
                                        /* XXX: make a string for the engineId */
-                                       ep_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data);
+                                       g_string_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data);
                                }
                        }
 
                        if (u->engine.len == 0) {
                                if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
-                                       ep_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data);
+                                       g_string_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data);
                                }
                        }
                }
        }
 
        if (es->len) {
-               es = ep_strbuf_truncate(es,es->len-1);
-               *err = ep_strdup(es->str);
+               es = g_string_truncate(es,es->len-1);
+               *err = g_string_free(es, FALSE);
        }
 
        return;
index 527c753cc7efbfe265a6a16dabd37917675beba4..d3873cab67b66ce7730c99ba94e7a446fd48d79c 100644 (file)
@@ -408,7 +408,7 @@ static void macro_update(void* mp, const gchar** error) {
                if (m == &(macros[i])) continue;
 
                if ( g_str_equal(m->name,macros[i].name) ) {
-                       *error = ep_strdup_printf("macro '%s' exists already", m->name);
+                       *error = g_strdup_printf("macro '%s' exists already", m->name);
                        m->usable = FALSE;
                        return;
                }
index 2dc51e1ba665f4f5554d4e1865cba913d6d7ea95..29a5ecbaffd477267e4b0ad8ddfee883bcb50c3b 100644 (file)
@@ -1212,7 +1212,7 @@ static void uat_bootp_record_update_cb(void* r, const char** err) {
        uat_bootp_record_t* rec = (uat_bootp_record_t *)r;
 
        if ((rec->opt == 0) || (rec->opt >=BOOTP_OPT_NUM-1))
-               *err = ep_strdup_printf("Option must be between 1 and %d", BOOTP_OPT_NUM-2);
+               *err = g_strdup_printf("Option must be between 1 and %d", BOOTP_OPT_NUM-2);
 }
 
 static void uat_bootp_record_free_cb(void*r) {
@@ -5320,7 +5320,7 @@ bootp_init_protocol(void)
        /* Now apply the custom options */
        for (i = 0; i < num_bootp_records_uat; i++)
        {
-               bootp_opt[uat_bootp_records[i].opt].text = se_strdup(uat_bootp_records[i].text);
+               bootp_opt[uat_bootp_records[i].opt].text = wmem_strdup(wmem_file_scope(), uat_bootp_records[i].text);
                bootp_opt[uat_bootp_records[i].opt].ftype = uat_bootp_records[i].ftype;
                bootp_opt[uat_bootp_records[i].opt].phf = NULL;
        }
index 20b38e49683cd23e775daaca533ba8aeba01aa8a..6e66bfecd71243864b4a274b06967b975aad9c2a 100644 (file)
@@ -724,7 +724,7 @@ static const TOP_ELEMENT_CONTROL canonifyTable[] = {
   { FALSE, FALSE, 0x0,  TRUE, NULL, NULL }
 };
 
-static void 
+static void
 clear_canon(void)
 {
   const TOP_ELEMENT_CONTROL *t = canonifyTable;
@@ -787,10 +787,10 @@ c1222_uat_data_update_cb(void* n, const char** err)
   c1222_uat_data_t* new_rec = (c1222_uat_data_t *)n;
 
   if (new_rec->keynum > 0xff) {
-    *err = "Invalid key number; must be less than 256";
+    *err = g_strdup("Invalid key number; must be less than 256");
   }
   if (new_rec->keylen != EAX_SIZEOF_KEY) {
-    *err = "Invalid key size; must be 16 bytes";
+    *err = g_strdup("Invalid key size; must be 16 bytes");
   }
 }
 
index 8cb761af7ded560311cb0e0a7bfa4a94bd17a28a..af9566ab14e8117a072952a19cfbad6a392a27a8 100644 (file)
@@ -157,13 +157,13 @@ header_fields_update_cb(void *r, const char **err)
        char c;
 
        if (rec->header_name == NULL) {
-               *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't be empty");
+               *err = g_strdup("Header name can't be empty");
                return;
        }
 
        g_strstrip(rec->header_name);
        if (rec->header_name[0] == 0) {
-               *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't be empty");
+               *err = g_strdup("Header name can't be empty");
                return;
        }
 
@@ -172,7 +172,7 @@ header_fields_update_cb(void *r, const char **err)
         */
        c = proto_check_field_name(rec->header_name);
        if (c) {
-               *err = wmem_strdup_printf(wmem_packet_scope(), "Header name can't contain '%c'", c);
+               *err = g_strdup_printf("Header name can't contain '%c'", c);
                return;
        }
 
index eb55219ae3006a1046e6ba0f9b19e16555cfb6c1..beab53d2569018689d2344813563737412e90090 100644 (file)
@@ -172,7 +172,7 @@ uat_wep_key_record_update_cb(void* r, const char** err)
     decryption_key_t* dk;
 
     if (rec->string == NULL) {
-         *err = ep_strdup_printf("Key can't be blank");
+         *err = g_strdup("Key can't be blank");
     } else {
         g_strstrip(rec->string);
         dk = parse_key_string(rec->string, rec->key);
@@ -183,25 +183,25 @@ uat_wep_key_record_update_cb(void* r, const char** err)
               case AIRPDCAP_KEY_TYPE_WEP_40:
               case AIRPDCAP_KEY_TYPE_WEP_104:
                  if (rec->key != AIRPDCAP_KEY_TYPE_WEP) {
-                    *err = ep_strdup_printf("Invalid key format");
+                    *err = g_strdup("Invalid key format");
                  }
                  break;
               case AIRPDCAP_KEY_TYPE_WPA_PWD:
                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) {
-                    *err = ep_strdup_printf("Invalid key format");
+                    *err = g_strdup("Invalid key format");
                  }
                  break;
               case AIRPDCAP_KEY_TYPE_WPA_PSK:
                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) {
-                    *err = ep_strdup_printf("Invalid key format");
+                    *err = g_strdup("Invalid key format");
                  }
                  break;
               default:
-                 *err = ep_strdup_printf("Invalid key format");
+                 *err = g_strdup("Invalid key format");
                  break;
            }
         } else {
-           *err = ep_strdup_printf("Invalid key format");
+           *err = g_strdup("Invalid key format");
         }
     }
 }
index a906817b97f887d66c9d6b3cd276c13890cd0c63..86e42a4bc13d1054e5fa04ae71d2ac2159349791 100644 (file)
@@ -134,15 +134,18 @@ addr_uat_update_cb(void *r, const char **err)
     static_addr_t *map = (static_addr_t *)r;
     /* Ensure a valid short address */
     if (map->addr16 >= IEEE802154_NO_ADDR16) {
-        *err = "Invalid short address";
+        *err = g_strdup("Invalid short address");
+       return;
     }
     /* Ensure a valid PAN identifier. */
     if (map->pan >= IEEE802154_BCAST_PAN) {
-        *err = "Invalid PAN identifier";
+        *err = g_strdup("Invalid PAN identifier");
+       return;
     }
     /* Ensure a valid EUI-64 length */
     if (map->eui64_len != sizeof(guint64)) {
-        *err = "Invalid EUI-64 length";
+        *err = g_strdup("Invalid EUI-64 length");
+       return;
     }
 } /* ieee802154_addr_uat_update_cb */
 
index 96d085e6bdf5238faca8d5843d7c2e5b36062ae8..5df000f3c2e579cb1aa51740ddf5d960feda19d7 100644 (file)
@@ -288,13 +288,13 @@ header_fields_update_cb(void *r, const char **err)
   char c;
 
   if (rec->header_name == NULL) {
-    *err = ep_strdup_printf("Header name can't be empty");
+    *err = g_strdup("Header name can't be empty");
     return;
   }
 
   g_strstrip(rec->header_name);
   if (rec->header_name[0] == 0) {
-    *err = ep_strdup_printf("Header name can't be empty");
+    *err = g_strdup("Header name can't be empty");
     return;
   }
 
@@ -303,7 +303,7 @@ header_fields_update_cb(void *r, const char **err)
    */
   c = proto_check_field_name(rec->header_name);
   if (c) {
-    *err = ep_strdup_printf("Header name can't contain '%c'", c);
+    *err = g_strdup_printf("Header name can't contain '%c'", c);
     return;
   }
 
index a7f1ea3f5a34ea466f41a4b6217509c1fa80fe8f..c826f092fcfed193cb3e9076d5db80182426cd6d 100644 (file)
@@ -4965,17 +4965,17 @@ static void ikev1_uat_data_update_cb(void* p, const char** err) {
   ikev1_uat_data_key_t *ud = (ikev1_uat_data_key_t *)p;
 
   if (ud->icookie_len != COOKIE_SIZE) {
-    *err = ep_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
+    *err = g_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
     return;
   }
 
   if (ud->key_len == 0) {
-    *err = ep_strdup_printf("Must have Encryption key.");
+    *err = g_strdup_printf("Must have Encryption key.");
     return;
   }
 
   if (ud->key_len > MAX_KEY_SIZE) {
-    *err = ep_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2);
+    *err = g_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2);
     return;
   }
 
@@ -4994,12 +4994,12 @@ static void ikev2_uat_data_update_cb(void* p, const char** err) {
   ikev2_uat_data_t *ud = (ikev2_uat_data_t *)p;
 
   if (ud->key.spii_len != COOKIE_SIZE) {
-    *err = ep_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
+    *err = g_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
     return;
   }
 
   if (ud->key.spir_len != COOKIE_SIZE) {
-    *err = ep_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
+    *err = g_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
     return;
   }
 
@@ -5012,25 +5012,25 @@ static void ikev2_uat_data_update_cb(void* p, const char** err) {
   }
 
   if (ud->sk_ei_len != ud->encr_spec->key_len) {
-    *err = ep_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
+    *err = g_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
              ud->sk_ei_len, ud->encr_spec->key_len);
     return;
   }
 
   if (ud->sk_er_len != ud->encr_spec->key_len) {
-    *err = ep_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
+    *err = g_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
              ud->sk_er_len, ud->encr_spec->key_len);
     return;
   }
 
   if (ud->sk_ai_len != ud->auth_spec->key_len) {
-    *err = ep_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
+    *err = g_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
              ud->sk_ai_len, ud->auth_spec->key_len);
     return;
   }
 
   if (ud->sk_ar_len != ud->auth_spec->key_len) {
-    *err = ep_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
+    *err = g_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
              ud->sk_ar_len, ud->auth_spec->key_len);
     return;
   }
index f7c5c1d52d42ef0f789438d3bd455172479de8f4..15a2ddbfb95cf79a2b6527991f6c0309472f812f 100644 (file)
@@ -310,7 +310,7 @@ k12_update_cb(void* r, const char** err)
        gchar** protos;
        guint num_protos, i;
 
-       protos = ep_strsplit(h->protos,":",0);
+       protos = g_strsplit(h->protos,":",0);
 
        for (num_protos = 0; protos[num_protos]; num_protos++)
                g_strstrip(protos[num_protos]);
@@ -321,11 +321,13 @@ k12_update_cb(void* r, const char** err)
        for (i = 0; i < num_protos; i++) {
                if ( ! (h->handles[i] = find_dissector(protos[i])) ) {
                        h->handles[i] = data_handle;
-                       *err = ep_strdup_printf("Could not find dissector for: '%s'",protos[i]);
+                       g_strfreev(protos);
+                       *err = g_strdup_printf("Could not find dissector for: '%s'",protos[i]);
                        return;
                }
        }
 
+       g_strfreev(protos);
        *err = NULL;
 }
 
index f9c0da4be6f68841fe8f4e1a75854d8cb4025243..28508ba8a81295b0fe3365938574879365ac8e84 100644 (file)
@@ -627,13 +627,13 @@ attribute_types_update_cb(void *r, const char **err)
   char c;
 
   if (rec->attribute_type == NULL) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+    *err = g_strdup("Attribute type can't be empty");
     return;
   }
 
   g_strstrip(rec->attribute_type);
   if (rec->attribute_type[0] == 0) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+    *err = g_strdup("Attribute type can't be empty");
     return;
   }
 
@@ -642,7 +642,7 @@ attribute_types_update_cb(void *r, const char **err)
    */
   c = proto_check_field_name(rec->attribute_type);
   if (c) {
-    *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c);
+    *err = g_strdup_printf("Attribute type can't contain '%c'", c);
     return;
   }
 
index 6a6653932e25601b917d944d1627eb8271ec74bc..3b77eb51cdc68d56368238bc88a38bfad5f8978f 100644 (file)
@@ -3404,12 +3404,12 @@ sccp_users_update_cb(void *r, const char **err)
 
   empty = range_empty();
   if (ranges_are_equal(u->called_pc, empty)) {
-          *err = ep_strdup_printf("Must specify a PC");
+          *err = g_strdup("Must specify a PC");
           return;
   }
 
   if (ranges_are_equal(u->called_ssn, empty)) {
-          *err = ep_strdup_printf("Must specify an SSN");
+          *err = g_strdup("Must specify an SSN");
           return;
   }
 
index ff54f92de194ba02af08c521b5acb53e07361ec2..4a59cbc024b75f01f7cddf379227fa2a07250c80 100644 (file)
@@ -3445,7 +3445,7 @@ static void
 snmp_users_update_cb(void* p _U_, const char** err)
 {
        snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p;
-       emem_strbuf_t* es = ep_strbuf_new("");
+       GString* es = g_string_new("");
        unsigned int i;
 
        *err = NULL;
@@ -3455,14 +3455,14 @@ snmp_users_update_cb(void* p _U_, const char** err)
                return;
 
        if (! ue->user.userName.len)
-               ep_strbuf_append_printf(es,"no userName\n");
+               g_string_append_printf(es,"no userName\n");
 
        for (i=0; i<num_ueas-1; i++) {
                snmp_ue_assoc_t* u = &(ueas[i]);
 
                /* RFC 3411 section 5 */
                if ((u->engine.len > 0) && (u->engine.len < 5 || u->engine.len > 32)) {
-                       ep_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len);
+                       g_string_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len);
                }
 
 
@@ -3472,21 +3472,21 @@ snmp_users_update_cb(void* p _U_, const char** err)
                        if (u->engine.len > 0 && memcmp( u->engine.data,   ue->engine.data,  u->engine.len ) == 0) {
                                if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
                                        /* XXX: make a string for the engineId */
-                                       ep_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data);
+                                       g_string_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data);
                                }
                        }
 
                        if (u->engine.len == 0) {
                                if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
-                                       ep_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data);
+                                       g_string_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data);
                                }
                        }
                }
        }
 
        if (es->len) {
-               es = ep_strbuf_truncate(es,es->len-1);
-               *err = ep_strdup(es->str);
+               es = g_string_truncate(es,es->len-1);
+               *err = g_string_free(es, FALSE);
        }
 
        return;
index 4b558a7fa660ac866cbe3303af13fa7c4671ea23..9406c788078b913acc3911b7429b8772247460c7 100644 (file)
@@ -5249,14 +5249,6 @@ ssldecrypt_free_cb(void *r)
     g_free(h->password);
 }
 
-static void
-ssldecrypt_update_cb(void *r _U_, const char **err)
-{
-    if (err)
-            *err = NULL;
-    return;
-}
-
 static void*
 ssldecrypt_copy_cb(void *dest, const void *orig, size_t len _U_)
 {
@@ -6085,7 +6077,7 @@ proto_register_ssl(void)
             UAT_AFFECTS_DISSECTION,         /* affects dissection of packets, but not set of named fields */
             NULL,                           /* Help section (currently a wiki page) */
             ssldecrypt_copy_cb,
-            ssldecrypt_update_cb,
+            NULL,
             ssldecrypt_free_cb,
             ssl_parse_uat,
             sslkeylist_uats_flds);
index 24103a32f30a1a2877e3b62c224c752cd91a8327..b635bb2c631cb1ee5faa90cc55601bc10023a32f 100644 (file)
@@ -175,7 +175,7 @@ vcdu_uat_data_update_cb(void *p, const char **err) {
     uat_channel_t *ud = (uat_channel_t *)p;
 
     if (ud->channel >= 64) {
-        *err = wmem_strdup_printf(wmem_packet_scope(), "Channel must be between 0-63.");
+        *err = g_strdup("Channel must be between 0-63.");
         return;
     }
 }
index cd0c6e665bba391f8d96754f4b73057be1a478a7..952d270047c52b8223efbb79082b41ec3265da04 100644 (file)
@@ -160,18 +160,18 @@ static void uat_key_record_update_cb(void* r, const char** err) {
     uat_key_record_t* rec = (uat_key_record_t *)r;
 
     if (rec->string == NULL) {
-         *err = ep_strdup_printf("Key can't be blank");
+       *err = g_strdup("Key can't be blank");
     } else {
         g_strstrip(rec->string);
 
         if (rec->string[0] != 0) {
             *err = NULL;
             if ( !zbee_security_parse_key(rec->string, rec->key, rec->byte_order) ) {
-                *err = ep_strdup_printf("Expecting %d hexadecimal bytes or\n"
+                *err = g_strdup_printf("Expecting %d hexadecimal bytes or\n"
                         "a %d character double-quoted string", ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE);
             }
         } else {
-            *err = ep_strdup_printf("Key can't be blank");
+            *err = g_strdup("Key can't be blank");
         }
     }
 }
index 5f621cade566c6de3d2c03f405eeba184e97eab6..c591a0f75bd1dfe3e2c347af3c9883a75b1a34d5 100644 (file)
@@ -195,7 +195,7 @@ static void geoip_db_post_update_cb(void) {
 /**
  * Initialize GeoIP lookups
  */
-void 
+void
 geoip_db_pref_init(module_t *nameres)
 {
     static uat_field_t geoip_db_paths_fields[] = {
index 117bb3355cd2a87913c83936eac786e39015742e..dd42dd80b3861870ab95d73da5fa929368a3d4aa 100644 (file)
@@ -81,7 +81,10 @@ static guint linenum;
 static gchar *parse_str;
 static guint parse_str_pos;
 
-#define ERROR(fmtd) do { error = ep_strdup_printf("%s:%d: %s",uat->filename,linenum,ep_strdup_printf fmtd); yyterminate(); } while(0)
+#define ERROR(fmtd) do { \
+    error = ep_strdup_printf("%s:%d: %s",uat->filename,linenum,ep_strdup_printf fmtd); \
+    yyterminate(); \
+} while(0)
 
 #define SET_FIELD() \
        { const gchar* errx; \
@@ -237,7 +240,7 @@ comment #[^\n]*\n
 
 <END_OF_RECORD>{newline} {
        void* rec;
-       const gchar* err = NULL;
+       const char* err = NULL;
 
        linenum++;
 
@@ -251,7 +254,12 @@ comment #[^\n]*\n
                uat->update_cb(rec,&err);
 
        if (err) {
-               ERROR(("%s",err));
+               char *tmp = ep_strdup(err);
+               /* XXX bit of a hack to remove emem from dissectors, this can
+                * be removed as proper use of glib memory is propogated
+                * through the rest of the UAT code */
+               g_free((char*)err);
+               ERROR(("%s",tmp));
        }
 
        valid_record = TRUE;
index 6adf6d4605fe0cb371ec5972f41fe0de6daa1a84..97948fff75de95ce1b7480724bd36b10fea6a2b1 100644 (file)
@@ -73,7 +73,7 @@ uat_plen_record_update_cb(void *r, const char **err)
 {
        uat_plen_record_t *rec = (uat_plen_record_t*)r;
        if (rec->packet_range->nranges < 1) {
-               *err = ep_strdup_printf("Invalid range string");
+               *err = g_strdup("Invalid range string");
                return;
        }
 
index 4b458ec562f1cfebbda5a41adda39f6bfc5b0049..cc58605ceb662d0bf142e08ec8cd3636634574e3 100644 (file)
@@ -373,7 +373,13 @@ static gboolean uat_dlg_cb(GtkWidget *win _U_, gpointer user_data) {
                dd->uat->update_cb(dd->rec, &err);
 
                if (err) {
-                       err = ep_strdup_printf("error updating record: %s", err);
+                       char *tmp;
+                       tmp = ep_strdup_printf("error updating record: %s", err);
+                       /* XXX bit of a hack to remove emem from dissectors, this can
+                        * be removed as proper use of glib memory is propogated
+                        * through the rest of the UAT code */
+                       g_free((char*)err);
+                       err = tmp;
                        goto on_failure;
                }
        }