Browse Source

smb_trans2: Check for smb_message_new failures

fix cid #65529

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Hugo Beauzée-Luyssen 9 years ago
parent
commit
5d5ce572bf
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/smb_trans2.c

+ 5 - 0
src/smb_trans2.c

@@ -258,6 +258,11 @@ static smb_message  *smb_trans2_find_next (smb_session *s, smb_tid tid, uint16_t
     }
     }
 
 
     msg_find_next2 = smb_message_new(SMB_CMD_TRANS2);
     msg_find_next2 = smb_message_new(SMB_CMD_TRANS2);
+    if (!msg_find_next2)
+    {
+        free(utf_pattern);
+        return NULL;
+    }
     msg_find_next2->packet->header.tid = (uint16_t)tid;
     msg_find_next2->packet->header.tid = (uint16_t)tid;
 
 
     SMB_MSG_INIT_PKT(tr2_find_next2);
     SMB_MSG_INIT_PKT(tr2_find_next2);