From 753e9f65e5a39009248a86dce20fd71178560bd0 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 16 Jul 2009 20:52:36 +0000 Subject: Zero out the packet_info struct for each packet instead of trying to initialize everything by hand. Fixes a Valgrind warning. svn path=/trunk/; revision=29122 --- epan/packet.c | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'epan/packet.c') diff --git a/epan/packet.c b/epan/packet.c index 39eefb0b07..ceb3426c4c 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -263,70 +263,24 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, { if (cinfo != NULL) col_init(cinfo); + memset(&edt->pi, 0, sizeof(edt->pi)); edt->pi.current_proto = ""; edt->pi.cinfo = cinfo; edt->pi.fd = fd; edt->pi.pseudo_header = pseudo_header; - edt->pi.data_src = NULL; edt->pi.dl_src.type = AT_NONE; - edt->pi.dl_src.len = 0; - edt->pi.dl_src.data = NULL; edt->pi.dl_dst.type = AT_NONE; - edt->pi.dl_dst.len = 0; - edt->pi.dl_dst.data = NULL; edt->pi.net_src.type = AT_NONE; - edt->pi.net_src.len = 0; - edt->pi.net_src.data = NULL; edt->pi.net_dst.type = AT_NONE; - edt->pi.net_dst.len = 0; - edt->pi.net_dst.data = NULL; edt->pi.src.type = AT_NONE; - edt->pi.src.len = 0; - edt->pi.src.data = NULL; edt->pi.dst.type = AT_NONE; - edt->pi.dst.len = 0; - edt->pi.dst.data = NULL; - edt->pi.ethertype = 0; - edt->pi.mpls_label = 0; - edt->pi.ipproto = 0; - edt->pi.ipxptype = 0; edt->pi.ctype = CT_NONE; - edt->pi.circuit_id = 0; edt->pi.noreassembly_reason = ""; - edt->pi.fragmented = FALSE; - edt->pi.in_error_pkt = FALSE; edt->pi.ptype = PT_NONE; - edt->pi.srcport = 0; - edt->pi.destport = 0; - edt->pi.match_port = 0; - edt->pi.match_string = NULL; - edt->pi.can_desegment = 0; - edt->pi.want_pdu_tracking = 0; edt->pi.p2p_dir = P2P_DIR_UNKNOWN; - edt->pi.private_data = NULL; - edt->pi.oxid = 0; - edt->pi.rxid = 0; - edt->pi.r_ctl = 0; - edt->pi.src_idx = 0; - edt->pi.dst_idx = 0; - edt->pi.vsan = 0; - edt->pi.dcectxid = 0; edt->pi.dcetransporttype = -1; - edt->pi.decrypt_gssapi_tvb = 0; - edt->pi.gssapi_wrap_tvb = NULL; - edt->pi.gssapi_encrypted_tvb = NULL; - edt->pi.gssapi_decrypted_tvb = NULL; - edt->pi.layer_names = NULL; - edt->pi.link_number = 0; edt->pi.annex_a_used = MTP2_ANNEX_A_USED_UNKNOWN; - edt->pi.profinet_conv = NULL; - edt->pi.profinet_type = 0; - edt->pi.usb_conv_info = NULL; - edt->pi.tcp_tree = NULL; edt->pi.dcerpc_procedure_name=""; - edt->pi.sccp_info = NULL; - edt->pi.clnp_srcref = 0; - edt->pi.clnp_dstref = 0; edt->pi.link_dir = LINK_DIR_UNKNOWN; EP_CHECK_CANARY(("before dissecting frame %d",fd->num)); -- cgit v1.2.1