浏览代码

[LWIP] fixed select issues: pollset need clean.

aozima 7 年之前
父节点
当前提交
108a1434cd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      components/dfs/src/select.c

+ 1 - 1
components/dfs/src/select.c

@@ -52,7 +52,7 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struc
     /* Allocate the descriptor list for poll() */
     /* Allocate the descriptor list for poll() */
     if (npfds > 0)
     if (npfds > 0)
     {
     {
-        pollset = (struct pollfd *)rt_malloc(npfds * sizeof(struct pollfd));
+        pollset = (struct pollfd *)rt_calloc(npfds, sizeof(struct pollfd));
         if (!pollset)
         if (!pollset)
         {
         {
             return -1;
             return -1;