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 <philippe.deswert@jollamobile.com>
This commit is contained in:
Philippe De Swert 2014-05-27 13:42:39 +03:00 committed by Jouni Malinen
parent 5519241676
commit 68e2b8882a

View file

@ -1092,8 +1092,10 @@ static int tncc_read_config(struct tncc_data *tncc)
int error = 0; int error = 0;
imc = tncc_parse_imc(pos + 4, line_end, &error); imc = tncc_parse_imc(pos + 4, line_end, &error);
if (error) if (error) {
os_free(config);
return -1; return -1;
}
if (imc) { if (imc) {
if (last == NULL) if (last == NULL)
tncc->imc = imc; tncc->imc = imc;