浏览代码

smb_trans2: Check for smb_message_new failures

fix cid #65529

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Hugo Beauzée-Luyssen 9 年之前
父节点
当前提交
5d5ce572bf
共有 1 个文件被更改,包括 5 次插入0 次删除
  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);
+    if (!msg_find_next2)
+    {
+        free(utf_pattern);
+        return NULL;
+    }
     msg_find_next2->packet->header.tid = (uint16_t)tid;
 
     SMB_MSG_INIT_PKT(tr2_find_next2);