Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove "out of memory" log messages.
They're not needed.  If we're OOM, the server core will print
them, or the entire system will go down.
  • Loading branch information
alandekok committed Mar 29, 2013
1 parent e84ae0c commit eff18a4
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 42 deletions.
3 changes: 0 additions & 3 deletions src/modules/rlm_eap/eap.c
Expand Up @@ -1098,7 +1098,6 @@ eap_handler_t *eap_handler(rlm_eap_t *inst, eap_packet_raw_t **eap_packet_p,
RDEBUG2("Broken NAS did not set User-Name, setting from EAP Identity");
vp = pairmake(request->packet, NULL, "User-Name", handler->identity, T_OP_EQ);
if (vp == NULL) {
RDEBUG("Out of memory");
goto error;
}
vp->next = request->packet->vps;
Expand All @@ -1123,7 +1122,6 @@ eap_handler_t *eap_handler(rlm_eap_t *inst, eap_packet_raw_t **eap_packet_p,
} else { /* packet was EAP identity */
handler = eap_handler_alloc(inst);
if (handler == NULL) {
RDEBUG("Out of memory.");
goto error;
}

Expand All @@ -1150,7 +1148,6 @@ eap_handler_t *eap_handler(rlm_eap_t *inst, eap_packet_raw_t **eap_packet_p,
RDEBUG2W("NAS did not set User-Name. Setting it locally from EAP Identity");
vp = pairmake(request->packet, NULL, "User-Name", handler->identity, T_OP_EQ);
if (vp == NULL) {
RDEBUG("Out of memory");
goto error2;
}
vp->next = request->packet->vps;
Expand Down
2 changes: 0 additions & 2 deletions src/modules/rlm_eap/libeap/eap_tls.c
Expand Up @@ -592,7 +592,6 @@ static EAPTLS_PACKET *eaptls_extract(REQUEST *request, EAP_DS *eap_ds, fr_tls_st
tlspacket->data = talloc_array(tlspacket, uint8_t,
data_len);
if (tlspacket->data == NULL) {
RDEBUG("out of memory");
talloc_free(tlspacket);
return NULL;
}
Expand Down Expand Up @@ -885,7 +884,6 @@ int eaptls_compose(EAP_DS *eap_ds, EAPTLS_PACKET *reply)
eap_ds->request->type.data = talloc_array(eap_ds->request, uint8_t,
reply->length - TLS_HEADER_LEN + 1);
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "out of memory");
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions src/modules/rlm_eap/libeap/eapcommon.c
Expand Up @@ -149,7 +149,6 @@ int eap_wireformat(eap_packet_t *reply)
reply->packet = talloc_array(reply, uint8_t, total_length);
header = (eap_packet_raw_t *)reply->packet;
if (!header) {
radlog(L_ERR, "rlm_eap: out of memory");
return EAP_INVALID;
}

Expand Down Expand Up @@ -356,7 +355,6 @@ eap_packet_raw_t *eap_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps)
*/
eap_packet = (eap_packet_raw_t *) talloc_zero_array(ctx, uint8_t, len);
if (eap_packet == NULL) {
radlog(L_ERR, "rlm_eap: out of memory");
return NULL;
}

Expand Down
2 changes: 0 additions & 2 deletions src/modules/rlm_eap/libeap/eapsimlib.c
Expand Up @@ -189,7 +189,6 @@ int map_eapsim_basictypes(RADIUS_PACKET *r, eap_packet_t *ep)
encoded_size += 3;
encodedmsg = talloc_array(ep, uint8_t, encoded_size);
if (encodedmsg == NULL) {
radlog(L_ERR, "eapsim: out of memory allocating %d bytes", encoded_size+5);
return 0;
}
memset(encodedmsg, 0, encoded_size);
Expand Down Expand Up @@ -262,7 +261,6 @@ int map_eapsim_basictypes(RADIUS_PACKET *r, eap_packet_t *ep)
buffer = talloc_array(r, uint8_t, hmaclen);
hdr = (eap_packet_raw_t *)buffer;
if (!hdr) {
radlog(L_ERR, "rlm_eap: out of memory");
talloc_free(encodedmsg);
return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
Expand Up @@ -108,7 +108,6 @@ static int gtc_initiate(void *instance, eap_handler_t *handler)
eap_ds->request->type.data = talloc_array(eap_ds->request,
uint8_t, length);
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "rlm_eap_gtc: out of memory");
return 0;
}

Expand Down Expand Up @@ -210,7 +209,6 @@ static int mod_authenticate(void *instance, eap_handler_t *handler)

vp = pairmake_packet("User-Password", "", T_OP_EQ);
if (!vp) {
radlog(L_ERR, "rlm_eap_gtc: out of memory");
return 0;
}
vp->length = eap_ds->response->type.length;
Expand Down
1 change: 0 additions & 1 deletion src/modules/rlm_eap/types/rlm_eap_ikev2/rlm_eap_ikev2.c
Expand Up @@ -81,7 +81,6 @@ static int ComposeRadMsg(uint8_t *out,u_int32_t olen, EAP_DS *eap_ds){
eap_ds->request->type.data = talloc_array(eap_ds->request,
uint8_t, len);
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, IKEv2_LOG_PREFIX "out of memory");
return 1;
}
memcpy(eap_ds->request->type.data,out+5,len-5);
Expand Down
8 changes: 0 additions & 8 deletions src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.c
Expand Up @@ -131,7 +131,6 @@ leap_packet_t *eapleap_extract(EAP_DS *eap_ds)

packet->challenge = talloc_array(packet, uint8_t, packet->count);
if (packet->challenge == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(packet);
return NULL;
}
Expand All @@ -148,7 +147,6 @@ leap_packet_t *eapleap_extract(EAP_DS *eap_ds)
if (name_len > 0) {
packet->name = talloc_array(packet, char, name_len + 1);
if (!packet->name) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(packet);
return NULL;
}
Expand Down Expand Up @@ -270,7 +268,6 @@ leap_packet_t *eapleap_stage6(leap_packet_t *packet, REQUEST *request,

reply->challenge = talloc_array(reply, uint8_t, reply->count);
if (reply->challenge == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(reply);
return NULL;
}
Expand All @@ -280,7 +277,6 @@ leap_packet_t *eapleap_stage6(leap_packet_t *packet, REQUEST *request,
*/
reply->name = talloc_array(reply, char, user_name->length + 1);
if (reply->name == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(reply);
return NULL;
}
Expand Down Expand Up @@ -359,7 +355,6 @@ leap_packet_t *eapleap_initiate(EAP_DS *eap_ds, VALUE_PAIR *user_name)

reply = talloc(eap_ds, leap_packet_t);
if (reply == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
return NULL;
}

Expand All @@ -369,7 +364,6 @@ leap_packet_t *eapleap_initiate(EAP_DS *eap_ds, VALUE_PAIR *user_name)

reply->challenge = talloc_array(reply, uint8_t, reply->count);
if (reply->challenge == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(reply);
return NULL;
}
Expand All @@ -388,7 +382,6 @@ leap_packet_t *eapleap_initiate(EAP_DS *eap_ds, VALUE_PAIR *user_name)
*/
reply->name = talloc_array(reply, char, user_name->length + 1);
if (reply->name == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
talloc_free(reply);
return NULL;
}
Expand Down Expand Up @@ -423,7 +416,6 @@ int eapleap_compose(EAP_DS *eap_ds, leap_packet_t *reply)
uint8_t,
reply->length);
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "rlm_eap_leap: out of memory");
return 0;
}
data = (leap_packet_raw_t *) eap_ds->request->type.data;
Expand Down
1 change: 0 additions & 1 deletion src/modules/rlm_eap/types/rlm_eap_leap/rlm_eap_leap.c
Expand Up @@ -61,7 +61,6 @@ static int leap_initiate(UNUSED void *instance, eap_handler_t *handler)

handler->opaque = session = talloc(handler, leap_session_t);
if (!handler->opaque) {
radlog(L_ERR, "rlm_eap_leap: Out of memory");
talloc_free(reply);
return 0;
}
Expand Down
3 changes: 0 additions & 3 deletions src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.c
Expand Up @@ -99,7 +99,6 @@ MD5_PACKET *eapmd5_extract(EAP_DS *eap_ds)
*/
packet->value = talloc_array(packet, uint8_t, packet->value_size);
if (packet->value == NULL) {
radlog(L_ERR, "rlm_eap_md5: out of memory");
talloc_free(packet);
return NULL;
}
Expand All @@ -113,7 +112,6 @@ MD5_PACKET *eapmd5_extract(EAP_DS *eap_ds)
if (name_len) {
packet->name = talloc_array(packet, char, name_len + 1);
if (!packet->name) {
radlog(L_ERR, "rlm_eap_md5: out of memory");
talloc_free(packet);
return NULL;
}
Expand Down Expand Up @@ -197,7 +195,6 @@ int eapmd5_compose(EAP_DS *eap_ds, MD5_PACKET *reply)
reply->length);
if (eap_ds->request->type.data == NULL) {
talloc_free(reply);
radlog(L_ERR, "rlm_eap_md5: out of memory");
return 0;
}
ptr = eap_ds->request->type.data;
Expand Down
2 changes: 0 additions & 2 deletions src/modules/rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c
Expand Up @@ -46,7 +46,6 @@ static int md5_initiate(void *instance, eap_handler_t *handler)
*/
reply = talloc(handler, MD5_PACKET);
if (reply == NULL) {
radlog(L_ERR, "rlm_eap_md5: out of memory");
return 0;
}

Expand All @@ -62,7 +61,6 @@ static int md5_initiate(void *instance, eap_handler_t *handler)
*/
reply->value = talloc_array(reply, uint8_t, reply->value_size);
if (reply->value == NULL) {
radlog(L_ERR, "rlm_eap_md5: out of memory");
talloc_free(reply);
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c
Expand Up @@ -125,7 +125,6 @@ static int eapmschapv2_compose(eap_handler_t *handler, VALUE_PAIR *reply)
* Allocate room for the EAP-MS-CHAPv2 data.
*/
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}
eap_ds->request->type.length = length;
Expand Down Expand Up @@ -168,7 +167,6 @@ static int eapmschapv2_compose(eap_handler_t *handler, VALUE_PAIR *reply)
* Allocate room for the EAP-MS-CHAPv2 data.
*/
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}
memset(eap_ds->request->type.data, 0, length);
Expand All @@ -191,7 +189,6 @@ static int eapmschapv2_compose(eap_handler_t *handler, VALUE_PAIR *reply)
* Allocate room for the EAP-MS-CHAPv2 data.
*/
if (eap_ds->request->type.data == NULL) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}
memset(eap_ds->request->type.data, 0, length);
Expand Down Expand Up @@ -417,7 +414,6 @@ static int mschapv2_authenticate(void *arg, eap_handler_t *handler)

challenge = pairmake_packet("MS-CHAP-Challenge", "0x00", T_OP_EQ);
if (!challenge) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}
challenge->length = MSCHAPV2_CHALLENGE_LEN;
Expand Down Expand Up @@ -570,15 +566,13 @@ static int mschapv2_authenticate(void *arg, eap_handler_t *handler)
*/
challenge = pairmake_packet("MS-CHAP-Challenge", "0x00", T_OP_EQ);
if (!challenge) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}
challenge->length = MSCHAPV2_CHALLENGE_LEN;
memcpy(challenge->vp_strvalue, data->challenge, MSCHAPV2_CHALLENGE_LEN);

response = pairmake_packet("MS-CHAP2-Response", "0x00", T_OP_EQ);
if (!response) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}

Expand All @@ -590,7 +584,6 @@ static int mschapv2_authenticate(void *arg, eap_handler_t *handler)

name = pairmake_packet("NTLM-User-Name", "", T_OP_EQ);
if (!name) {
radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
return 0;
}

Expand Down
5 changes: 0 additions & 5 deletions src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c
Expand Up @@ -210,7 +210,6 @@ eap_pwd_initiate (void *instance, eap_handler_t *handler)
}

if ((pwd_session = talloc_zero(handler, pwd_session_t)) == NULL) {
radlog(L_ERR, "rlm_eap_pwd: initiate, out of memory (1)");
return -1;
}
/*
Expand Down Expand Up @@ -255,7 +254,6 @@ eap_pwd_initiate (void *instance, eap_handler_t *handler)
pwd_session->out_buf_len = sizeof(pwd_id_packet) + strlen(inst->conf->server_id);
if ((pwd_session->out_buf = talloc_zero_array(pwd_session, uint8_t,
pwd_session->out_buf_len)) == NULL) {
radlog(L_ERR, "rlm_eap_pwd: initiate, out of memory to send ID request");
return -1;
}

Expand Down Expand Up @@ -357,7 +355,6 @@ mod_authenticate (void *arg, eap_handler_t *handler)
eap_ds->request->type.length = sizeof(pwd_hdr);
if ((eap_ds->request->type.data = talloc_array(eap_ds->request,
uint8_t, sizeof(pwd_hdr))) == NULL) {
radlog(L_ERR, "rlm_eap_pwd: fragment ACK, out of memory");
return 0;
}
hdr = (pwd_hdr *)eap_ds->request->type.data;
Expand Down Expand Up @@ -515,7 +512,6 @@ mod_authenticate (void *arg, eap_handler_t *handler)
(2 * BN_num_bytes(pwd_session->prime));
if ((pwd_session->out_buf = talloc_array(pwd_session, uint8_t,
pwd_session->out_buf_len)) == NULL) {
radlog(L_ERR, "rlm_eap_pwd: out of memory to send commit");
return 0;
}
memset(pwd_session->out_buf, 0, pwd_session->out_buf_len);
Expand Down Expand Up @@ -561,7 +557,6 @@ mod_authenticate (void *arg, eap_handler_t *handler)
pwd_session->out_buf_len = SHA256_DIGEST_LENGTH;
if ((pwd_session->out_buf = talloc_array(pwd_session, uint8_t,
pwd_session->out_buf_len)) == NULL) {
radlog(L_ERR, "rlm_eap_pwd: out of memory to send confirm");
return 0;
}
memset(pwd_session->out_buf, 0, pwd_session->out_buf_len);
Expand Down
1 change: 0 additions & 1 deletion src/modules/rlm_eap2/rlm_eap2.c
Expand Up @@ -821,7 +821,6 @@ static int eap_vp2data(VALUE_PAIR *vps, void **data, int *data_len)
*/
*data = malloc(len);
if (!*data) {
radlog(L_ERR, "rlm_eap2: out of memory");
return -1;
}
*data_len = len;
Expand Down
1 change: 0 additions & 1 deletion src/modules/rlm_radutmp/rlm_radutmp2.c
Expand Up @@ -460,7 +460,6 @@ static int radutmp_zap(rlm_radutmp_t *inst,
*/
offset_tree = rbtree_create(offset_cmp, NULL, 0);
if (!offset_tree) {
radlog(L_ERR, "rlm_radutmp: Out of memory");
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions src/modules/rlm_replicate/rlm_replicate.c
Expand Up @@ -143,7 +143,7 @@ static int replicate_packet(void *instance, REQUEST *request,
if (!vps) {
RDEBUGW("List '%s' doesn't exist for "
"this packet", fr_int2str(pair_lists,
list, "¿unknown?"));
list, "?unknown?"));
rcode = RLM_MODULE_INVALID;
goto done;
}
Expand All @@ -155,7 +155,6 @@ static int replicate_packet(void *instance, REQUEST *request,
if (*vps) {
packet->vps = paircopy(packet, *vps);
if (!packet->vps) {
RDEBUGE("Out of memory!");
rcode = RLM_MODULE_FAIL;
goto done;
}
Expand Down

0 comments on commit eff18a4

Please sign in to comment.