mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Merge pull request #643 from @kansal
Coverity Issue: Resource Leak fixed * pr/643: CLOUDSTACK-8692: Resource leak found by the internal coverity instance at Citrix fixed. Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
This commit is contained in:
commit
c1ac5f3abc
@ -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…
x
Reference in New Issue
Block a user