remove some g_malloc/g_free
authorstandel <standel@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 30 Mar 2007 08:22:08 +0000 (08:22 +0000)
committerstandel <standel@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 30 Mar 2007 08:22:08 +0000 (08:22 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21280 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-acn.c
epan/dissectors/packet-afs.c
epan/dissectors/packet-cops.c

index f76dcdca13fc01a09afc7029d56d8c27e95bcea3..37666fc39a8b7dab79d2e1a1a52e6ed3bf87405a 100644 (file)
@@ -776,7 +776,7 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of
      this in the same capture frame.  Could use se_alloc...
   */
   #define BUFFER_SIZE 128
-  buffer = g_malloc(BUFFER_SIZE);
+  buffer = ep_alloc(BUFFER_SIZE);
   buffer[0] = 0;
 
   A = ACN_DMP_ADT_EXTRACT_A(adt->flags);
@@ -950,8 +950,6 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of
       proto_item_set_text(ti, "Mixed size data items");
       break;
   } /* of switch (D) */
-  /* free our memory! */
-  g_free(buffer);
   
   return offset;
 }
@@ -976,7 +974,7 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
      this in the same capture frame.  Could use se_alloc...
   */
   #define BUFFER_SIZE 128
-  buffer = g_malloc(BUFFER_SIZE);
+  buffer = ep_alloc(BUFFER_SIZE);
 
   buffer[0] = 0;
 
@@ -1064,8 +1062,6 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
       } /* of (x=0;x<adt->count;x++) */
       break;
   } /* of switch (D) */
-  /* free our memory! */
-  g_free(buffer);
   
   return offset;
 }
index f61531b54eee25b82c0e1c89c5a469163c350793..bf7584107a2bf6ea7d6fd9b3ecce2f8efe989073 100644 (file)
@@ -420,12 +420,11 @@ static gint ett_afs_vldb_flags = -1;
                offset += 4; \
                p = tvb_get_ptr(tvb,offset,i); \
                len = ((i+4-1)/4)*4; \
-               tmp = g_malloc(i+1); \
+               tmp = ep_malloc(i+1); \
                memcpy(tmp, p, i); \
                tmp[i] = '\0'; \
                proto_tree_add_string(tree, field, tvb, offset-4, len+4, \
                (void *)tmp); \
-               g_free(tmp); \
                offset += len; \
        }
 
index fe1197406b41070a41ecb2fae8fe14830a24e4d7..2a65965557948be5ecb3010050a1d20112817551 100644 (file)
@@ -1557,7 +1557,7 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb,packet_info *pinfo, guint32 of
       offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &ber_tag);
       offset = dissect_ber_length(pinfo, tree, tvb, offset, &vb_length, &ind);
       oid_buf = tvb_get_ptr(tvb, vb_value_start, vb_length);
-      vb_oid = g_malloc((vb_length+1) * sizeof(gulong));
+      vb_oid = ep_malloc((vb_length+1) * sizeof(gulong));
       vb_oid_length = oid_to_subid_buf(oid_buf, vb_length, vb_oid, ((vb_length+1) * sizeof(gulong)));
 
       offset = offset + vb_length;
@@ -1617,7 +1617,6 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb,packet_info *pinfo, guint32 of
         }
 #endif /* HAVE_NET_SNMP */
       }
-      g_free(vb_oid);
       break;
 
     default: