aboutsummaryrefslogtreecommitdiffstats
path: root/epan/sigcomp_state_hdlr.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2004-11-23 22:02:00 +0000
committerAnders Broman <anders.broman@ericsson.com>2004-11-23 22:02:00 +0000
commit91c42c86554fd06d765c134f7b372362574e9d1f (patch)
tree16db039ad7f84cf65c9db920a7928723fc6a6c59 /epan/sigcomp_state_hdlr.c
parent236f1a971790db4ee36aa5d4ae0d3bd667057ab9 (diff)
Don't free string that don't need it. Added filter possibillity on Partial state
svn path=/trunk/; revision=12582
Diffstat (limited to 'epan/sigcomp_state_hdlr.c')
-rw-r--r--epan/sigcomp_state_hdlr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/sigcomp_state_hdlr.c b/epan/sigcomp_state_hdlr.c
index f50f863b8b..569088f38a 100644
--- a/epan/sigcomp_state_hdlr.c
+++ b/epan/sigcomp_state_hdlr.c
@@ -428,13 +428,12 @@ sigcomp_init_udvm(void){
* g_warning("g_hash_table_insert = 0x%x",sip_sdp_buff);
* g_warning("g_hash_table_insert = 0x%x",sip_sdp_buff);
*/
- g_free(partial_state_str);
}
int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_start, guint16 p_id_length, guint16 state_begin, guint16 *state_length,
- guint16 *state_address, guint16 state_instruction, gboolean state_vars_valid)
+ guint16 *state_address, guint16 state_instruction, gboolean state_vars_valid, gint hf_id)
{
int result_code = 0;
guint16 n;
@@ -470,7 +469,9 @@ int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_
n++;
}
partial_state_str = bytes_to_str(partial_state, p_id_length);
- proto_tree_add_text(tree,tvb, 0, -1,"Accessing state: %s",partial_state_str);
+ proto_tree_add_text(tree,tvb, 0, -1,"### Accessing state ###");
+ proto_tree_add_string(tree,hf_id, tvb, 0, 0, partial_state_str);
+
/* Debug
* g_warning("State Access: partial state =%s",partial_state_str);
* g_warning("g_hash_table_lookup = 0x%x",state_buff);
@@ -479,7 +480,6 @@ int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_
state_buff = g_hash_table_lookup(state_buffer_table, partial_state_str);
if ( state_buff == NULL ){
result_code = 2; /* No state match */
- g_free(partial_state_str);
return result_code;
}
/*
@@ -601,7 +601,6 @@ int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_
/* partial_state_ID_length */
buff[6] = p_id_length >> 8;
buff[7] = p_id_length & 0xff;
- g_free(partial_state_str);
return 0;
/*
* End SIP
@@ -637,8 +636,6 @@ void udvm_state_create(guint8 *state_buff,guint8 *state_identifier,guint16 p_id_
g_free(state_buff);
}
- g_free(partial_state_str);
-
}
void udvm_state_free(guint8 buff[],guint16 p_id_start,guint16 p_id_length){
@@ -656,7 +653,6 @@ void udvm_state_free(guint8 buff[],guint16 p_id_start,guint16 p_id_length){
i++;
}
partial_state_str = bytes_to_str(partial_state, p_id_length);
- g_free(partial_state_str);
/* TODO Implement a state create counter before actually freeing states
* Hmm is it a good idea to free the buffer at all?
g_warning("State-free on %s ",partial_state_str);