]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TNC: Fix minor memory leak (CID 62848)
authorPhilippe De Swert <philippe.deswert@jollamobile.com>
Tue, 27 May 2014 10:42:39 +0000 (13:42 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 16:44:58 +0000 (19:44 +0300)
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>
src/eap_peer/tncc.c

index 5b1a2d40edf4d5e88fbcf489b2d047176d08e000..7ca956e5b235dd2e1b160fd3d82dc953e5669738 100644 (file)
@@ -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;