Merge "wpa_supplicant: Free config only if it was allocated in same call"
am: eecc4372ad

Change-Id: I346953fe3c707f8b90d0fbc8c2049b3f337a9717
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 6b7abe2..0d70850 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -397,7 +397,8 @@
 	if (f == NULL) {
 		wpa_printf(MSG_ERROR, "Failed to open config file '%s', "
 			   "error: %s", name, strerror(errno));
-		os_free(config);
+		if (config != cfgp)
+			os_free(config);
 		return NULL;
 	}