Diff for /ansh/src/proc.c between versions 1.3.2.1 and 1.3.2.2

version 1.3.2.1, 2012/04/05 14:18:55 version 1.3.2.2, 2012/05/23 15:41:38
Line 55  InitProc(int h, io_sockaddr_t *sa, u_short id, int len Line 55  InitProc(int h, io_sockaddr_t *sa, u_short id, int len
   
         FTRACE(5);          FTRACE(5);
   
        proc = malloc(sizeof(struct tagProc));        proc = io_malloc(sizeof(struct tagProc));
         if (!proc) {          if (!proc) {
                 ERR("Not enough memory #%d - %s", errno, strerror(errno));                  ERR("Not enough memory #%d - %s", errno, strerror(errno));
                 return NULL;                  return NULL;
Line 67  InitProc(int h, io_sockaddr_t *sa, u_short id, int len Line 67  InitProc(int h, io_sockaddr_t *sa, u_short id, int len
                 memcpy(&proc->proc_cli, sa, sizeof(io_sockaddr_t));                  memcpy(&proc->proc_cli, sa, sizeof(io_sockaddr_t));
   
         proc->proc_blen = len;          proc->proc_blen = len;
        proc->proc_buf_[0] = malloc(proc->proc_blen);        proc->proc_buf_[0] = io_malloc(proc->proc_blen);
         if (!proc->proc_buf_[0]) {          if (!proc->proc_buf_[0]) {
                free(proc);                io_free(proc);
                 proc = NULL;                  proc = NULL;
         }          }
        proc->proc_buf_[1] = malloc(proc->proc_blen);        proc->proc_buf_[1] = io_malloc(proc->proc_blen);
         if (!proc->proc_buf_[1]) {          if (!proc->proc_buf_[1]) {
                free(proc->proc_buf_[0]);                io_free(proc->proc_buf_[0]);
                free(proc);                io_free(proc);
                 proc = NULL;                  proc = NULL;
         }          }
   
Line 105  FreeProc(struct tagProc ** __restrict proc) Line 105  FreeProc(struct tagProc ** __restrict proc)
                 return;                  return;
   
         if ((*proc)->proc_buf_[1])          if ((*proc)->proc_buf_[1])
                free((*proc)->proc_buf_[1]);                io_free((*proc)->proc_buf_[1]);
         if ((*proc)->proc_buf_[0])          if ((*proc)->proc_buf_[0])
                free((*proc)->proc_buf_[0]);                io_free((*proc)->proc_buf_[0]);
        free(*proc);        io_free(*proc);
         *proc = NULL;          *proc = NULL;
 }  }
   

Removed from v.1.3.2.1  
changed lines
  Added in v.1.3.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>