OSDN Git Service

wpa_supplicant: fix memory leak in -I option handling
authorJouni Malinen <j@w1.fi>
Tue, 23 Apr 2013 19:34:56 +0000 (12:34 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Tue, 23 Apr 2013 19:36:11 +0000 (12:36 -0700)
Change-Id: I1b393d245d606882e7bb548135d1eab99a988a81
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant/config.h
wpa_supplicant/main.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index f83499c..4a175ce 100644 (file)
@@ -912,7 +912,7 @@ int wpa_config_process_global(struct wpa_config *config, char *pos, int line);
  * wpa_config_read - Read and parse configuration database
  * @name: Name of the configuration (e.g., path and file name for the
  * configuration file)
- * @cfgp: Pointer to previousely allocated configuration data
+ * @cfgp: Pointer to previously allocated configuration data or %NULL if none
  * Returns: Pointer to allocated configuration data or %NULL on failure
  *
  * This function reads configuration data, parses its contents, and allocates
index c3ecbb3..1744620 100644 (file)
@@ -32,7 +32,8 @@ static void usage(void)
               "        [-o<override driver>] [-O<override ctrl>] \\\n"
               "        [-N -i<ifname> -c<conf> [-C<ctrl>] "
               "[-D<driver>] \\\n"
-              "        [-p<driver_param>] [-b<br_ifname>] [-I<config file>]\n"
+              "        [-p<driver_param>] [-b<br_ifname>] [-I<config file>] "
+              "...]\n"
               "\n"
               "drivers:\n",
               wpa_supplicant_version, wpa_supplicant_license);
@@ -50,7 +51,7 @@ static void usage(void)
               "  -c = Configuration file\n"
               "  -C = ctrl_interface parameter (only used if -c is not)\n"
               "  -i = interface name\n"
-              "  -I = additional Configuration file\n"
+              "  -I = additional configuration file\n"
               "  -d = increase debugging verbosity (-dd even more)\n"
               "  -D = driver name (can be multiple drivers: nl80211,wext)\n"
               "  -e = entropy file\n");
index 398fca1..4483173 100644 (file)
@@ -399,6 +399,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
        os_free(wpa_s->confname);
        wpa_s->confname = NULL;
 
+       os_free(wpa_s->confanother);
+       wpa_s->confanother = NULL;
+
        wpa_sm_set_eapol(wpa_s->wpa, NULL);
        eapol_sm_deinit(wpa_s->eapol);
        wpa_s->eapol = NULL;
index b47c11b..f96b245 100644 (file)
@@ -56,9 +56,10 @@ struct wpa_interface {
        const char *confname;
 
        /**
-        * confanother - Additional Configuration name (file or profile) name
+        * confanother - Additional configuration name (file or profile) name
         *
-        * This can also be %NULL when a configuration file is not used.
+        * This can also be %NULL when the additional configuration file is not
+        * used.
         */
        const char *confanother;