cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaanHoogland <>
Subject [GitHub] cloudstack pull request: Coverity Issue: Resource Leak fixed
Date Thu, 30 Jul 2015 11:10:33 GMT
Github user DaanHoogland commented on a diff in the pull request:
    --- Diff: server/src/org/apache/cloudstack/region/ ---
    @@ -186,8 +186,12 @@ protected static UserAccount makeUserAccountAPICall(Region region,
String comman
                     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;
    --- End diff --
    this return is not needed. we will fall through to other return. You can opt not to and
put another log message in there as well.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message