sftp_pkt_free(pktin);
struct fxp_handle *fxp_opendir(char *path){    struct sftp_packet *pktin, *pktout;    int id;    pktout = sftp_pkt_init(SSH_FXP_OPENDIR);    sftp_pkt_adduint32(pktout, 0x456); /* request id */    sftp_pkt_addstring(pktout, path);    sftp_send(pktout);    pktin = sftp_recv();    if (!pktin) {	fxp_internal_error("did not receive a valid SFTP packet\n");	return NULL;    }    id = sftp_pkt_getuint32(pktin);    if (id != 0x456) {	fxp_internal_error("request ID mismatch\n");	return NULL;    }    if (pktin->type == SSH_FXP_HANDLE) {	char *hstring;	struct fxp_handle *handle;	int len;	sftp_pkt_getstring(pktin, &hstring, &len);	if (!hstring) {	    fxp_internal_error("OPENDIR returned malformed FXP_HANDLE\n");	    return NULL;	}	handle = smalloc(sizeof(struct fxp_handle));	handle->hstring = mkstr(hstring, len);	handle->hlen = len;	sftp_pkt_free(pktin);	return handle;    } else {	fxp_got_status(pktin);	return NULL;    }}