free(pending);
sfree(pending);
static int ssh_scp_recv(unsigned char *buf, int len) {    outptr = buf;    outlen = len;    /*     * See if the pending-input block contains some of what we     * need.     */    if (pendlen > 0) {        unsigned pendused = pendlen;        if (pendused > outlen)            pendused = outlen;	memcpy(outptr, pending, pendused);        memmove(pending, pending+pendused, pendlen-pendused);	outptr += pendused;	outlen -= pendused;        pendlen -= pendused;        if (pendlen == 0) {            pendsize = 0;            free(pending);            pending = NULL;        }        if (outlen == 0)            return len;    }    while (outlen > 0) {        fd_set readfds;        FD_ZERO(&readfds);        FD_SET(scp_ssh_socket, &readfds);        if (select(1, &readfds, NULL, NULL, NULL) < 0)            return 0;                  /* doom */        select_result((WPARAM)scp_ssh_socket, (LPARAM)FD_READ);    }    return len;}