File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
msal/src/main/java/com/microsoft/identity/client Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,23 @@ private static PublicClientApplicationConfiguration loadConfiguration(InputStrea
10661066 throw new IllegalArgumentException ("Unable to open provided configuration file." , e );
10671067 }
10681068 }
1069+ finally {
1070+ try {
1071+ configStream .close ();
1072+ } catch (IOException e ) {
1073+ if (isDefaultConfiguration ) {
1074+ com .microsoft .identity .common .internal .logging .Logger .warn (
1075+ TAG + "loadConfiguration" ,
1076+ "Unable to close default configuration file. This can cause memory leak."
1077+ );
1078+ } else {
1079+ com .microsoft .identity .common .internal .logging .Logger .warn (
1080+ TAG + "loadConfiguration" ,
1081+ "Unable to close provided configuration file. This can cause memory leak."
1082+ );
1083+ }
1084+ }
1085+ }
10691086
10701087 final String config = new String (buffer );
10711088 final Gson gson = getGsonForLoadingConfiguration ();
@@ -1203,4 +1220,4 @@ public void onCancel() {
12031220 private OAuth2TokenCache <?, ?, ?> getOAuth2TokenCache () {
12041221 return initCommonCache (mPublicClientConfiguration .getAppContext ());
12051222 }
1206- }
1223+ }
You can’t perform that action at this time.
0 commit comments