smb2: fully initialize dummy session
authorEvan Huus <eapache@gmail.com>
Wed, 15 Oct 2014 12:22:09 +0000 (08:22 -0400)
committerEvan Huus <eapache@gmail.com>
Wed, 15 Oct 2014 12:24:04 +0000 (12:24 +0000)
A few fields weren't being zeroed and were causing valgrind warnings.

Bug: 10569
Change-Id: I30e1e70c9445376806f385f3578b65bf6e320f8b
Reviewed-on: https://code.wireshark.org/review/4702
Reviewed-by: Evan Huus <eapache@gmail.com>
epan/dissectors/packet-smb2.c

index 709734cf212aed9efcb63d604bdaca0fd8a89324..ebb16d60c96ac28b798caec2334e41ed44f51777 100644 (file)
@@ -6853,13 +6853,10 @@ dissect_smb2_tid_sesid(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb,
                 * a tree connect, we create a dummy sessison, so we can hang the
                 * tree data on it
                 */
-               si->session              = wmem_new(wmem_file_scope(), smb2_sesid_info_t);
-               si->session->sesid       = si->sesid;
-               si->session->acct_name   = NULL;
-               si->session->domain_name = NULL;
-               si->session->host_name   = NULL;
-               si->session->auth_frame  = (guint32)-1;
-               si->session->tids        = g_hash_table_new(smb2_tid_info_hash, smb2_tid_info_equal);
+               si->session = wmem_new0(wmem_file_scope(), smb2_sesid_info_t);
+               si->session->sesid      = si->sesid;
+               si->session->auth_frame = (guint32)-1;
+               si->session->tids       = g_hash_table_new(smb2_tid_info_hash, smb2_tid_info_equal);
                g_hash_table_insert(si->conv->sesids, si->session, si->session);
 
                return offset;