From 653509ddb5ced43b655a042783da6872b7ff85f8 Mon Sep 17 00:00:00 2001 From: aland Date: Tue, 15 May 2007 10:18:03 +0000 Subject: [PATCH] Port fix for Coverity bug #23 from 1.1.x --- src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c | 1 + src/modules/rlm_passwd/rlm_passwd.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c b/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c index 8df0f46..080b52f 100644 --- a/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c +++ b/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c @@ -508,6 +508,7 @@ static int eaptls_attach(CONF_SECTION *cs, void **instance) */ conf = (EAP_TLS_CONF *)malloc(sizeof(*conf)); if (conf == NULL) { + free(inst); radlog(L_ERR, "rlm_eap_tls: out of memory"); return -1; } diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index c30c137..5c22a68 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -184,7 +184,11 @@ static struct hashtable * build_hash_table (const char * file, int nfields, if (delimiter) ht->delimiter = delimiter; else ht->delimiter = ':'; if(!tablesize) return ht; - if(!(ht->fp = fopen(file,"r"))) return NULL; + if(!(ht->fp = fopen(file,"r"))) { + free(ht->filename); + free(ht); + return NULL; + } memset(ht->buffer, 0, 1024); ht->table = (struct mypasswd **) rad_malloc (tablesize * sizeof(struct mypasswd *)); if (!ht->table) { -- 2.1.4