diff options
author | Evan Huus <eapache@gmail.com> | 2013-10-25 22:14:25 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-10-25 22:14:25 +0000 |
commit | 95f484a91ee34ea3caa2c325170e52d0bf07489b (patch) | |
tree | 83a02ff6f4f38f36c739e437881a432c75eb88b6 /epan/dissectors/packet-k12.c | |
parent | 7a3febacac8fd14009dc82dc4d139ee43d37a437 (diff) |
Add a very small hack to make the UAT update callback error string freeable, and
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.
svn path=/trunk/; revision=52854
Diffstat (limited to 'epan/dissectors/packet-k12.c')
-rw-r--r-- | epan/dissectors/packet-k12.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index f7c5c1d52d..15a2ddbfb9 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -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; } |