From 68e2b8882a735b9758e37cd760884d4a5f2e449a Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Tue, 27 May 2014 13:42:39 +0300 Subject: [PATCH] TNC: Fix minor memory leak (CID 62848) In tncc_read_config(), the memory allocted for the config did not get freed if an error occured. Signed-off-by: Philippe De Swert --- src/eap_peer/tncc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eap_peer/tncc.c b/src/eap_peer/tncc.c index 5b1a2d40e..7ca956e5b 100644 --- a/src/eap_peer/tncc.c +++ b/src/eap_peer/tncc.c @@ -1092,8 +1092,10 @@ static int tncc_read_config(struct tncc_data *tncc) int error = 0; imc = tncc_parse_imc(pos + 4, line_end, &error); - if (error) + if (error) { + os_free(config); return -1; + } if (imc) { if (last == NULL) tncc->imc = imc;