*/
rcode = sendto(sockfd, data, data_len, flags,
(struct sockaddr *) &dst, sizeof_dst);
+#ifdef WITH_UDPFROMTO
done:
+#endif
if (rcode < 0) {
DEBUG("rad_send() failed: %s\n", strerror(errno));
}
* Attributes with encrypted values MUST be less than
* 128 bytes long.
*/
- switch (vp->flags.encrypt) {
+ if (packet) switch (vp->flags.encrypt) {
case FLAG_ENCRYPT_USER_PASSWORD:
make_passwd(ptr, &len, data, len,
secret, packet->vector);
ptr = start;
end = ptr + 255;
- vendorcode = total_length = 0;
+ total_length = 0;
length_ptr = vsa_length_ptr = tlv_length_ptr = NULL;
/*
*length_ptr += len;
if (vsa_length_ptr) *vsa_length_ptr += len;
if (tlv_length_ptr) *tlv_length_ptr += len;
- ptr += len;
total_length += len;
return total_length; /* of attribute */
}
vp = paircreate(attribute, PW_TYPE_OCTETS);
- if (!vp) return NULL;
+ if (!vp) {
+ free(tlv_data);
+ return NULL;
+ }
vp->type = PW_TYPE_TLV;
vp->flags.encrypt = FLAG_ENCRYPT_NONE;
*/
if (tlv_data != data) free(tlv_data);
- if (head->next) rad_sortvp(&head);
+ if (head && head->next) rad_sortvp(&head);
return head;
}