mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8692: Resource leak found by the internal coverity instance at Citrix fixed.
This commit is contained in:
parent
b400608162
commit
e0ba5302b6
|
|
@ -186,8 +186,12 @@ public class RegionsApiUtil {
|
|||
XStream xstream = new XStream(new DomDriver());
|
||||
xstream.alias("useraccount", UserAccountVO.class);
|
||||
xstream.aliasField("id", UserAccountVO.class, "uuid");
|
||||
ObjectInputStream in = xstream.createObjectInputStream(is);
|
||||
return (UserAccountVO)in.readObject();
|
||||
try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
|
||||
return (UserAccountVO)in.readObject();
|
||||
} catch (IOException e) {
|
||||
s_logger.error(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -304,4 +308,4 @@ public class RegionsApiUtil {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue