struct uio u;
int i;
struct iovec iov[RX_MAXIOVECS];
- struct sockaddr *sa;
+ struct sockaddr *sa = NULL;
int code;
int haveGlock = ISAFS_GLOCK();
if (haveGlock) {
AFS_GLOCK();
}
- *alength=*alength-u.uio_resid;
+ if (code)
+ return code;
+ *alength -= u.uio_resid;
if (sa) {
if (sa->sa_family == AF_INET) {
if (addr) *addr=*(struct sockaddr_in *)sa;
} else {
printf("Unknown socket family %d in NetReceive\n");
}
+ FREE(sa, M_SONAME);
}
return code;
}
RCSID("$Header$");
#ifdef AFS_FBSD40_ENV
+#include <sys/malloc.h>
#include "../rx/rx_kcommon.h"
struct uio u;
int i;
struct iovec iov[RX_MAXIOVECS];
- struct sockaddr *sa;
+ struct sockaddr *sa = NULL;
int code;
int haveGlock = ISAFS_GLOCK();
if (haveGlock) {
AFS_GLOCK();
}
- *alength=*alength-u.uio_resid;
+ if (code)
+ return code;
+ *alength -= u.uio_resid;
if (sa) {
if (sa->sa_family == AF_INET) {
if (addr) *addr=*(struct sockaddr_in *)sa;
} else {
printf("Unknown socket family %d in NetReceive\n", sa->sa_family);
}
+ FREE(sa, M_SONAME);
}
return code;
}
#if KNET_DEBUG
printf("+");
#endif
- code = sosend(asocket, addr, &u, NULL, NULL, 0, curproc);
+ code = sosend(asocket, (struct sockaddr *)addr, &u, NULL, NULL, 0,
+ curproc);
#if KNET_DEBUG
if (code) {
if (code == EINVAL)