Fix CID 1116743 Resource leak

This commit is contained in:
Hugo Trippaers 2013-11-07 16:22:53 +01:00
parent 5cb3cd64e5
commit f6f4a93145
1 changed files with 6 additions and 1 deletions

View File

@ -203,12 +203,17 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
rs = pstmt.executeQuery();
while (rs.next()) {
long sid = rs.getLong(1);
String rl = rs.getString(2);
long snid = rs.getLong(3);
return findByStoreSnapshot(role, sid, snid);
}
} catch (SQLException e) {
s_logger.debug("Failed to find parent snapshot: " + e.toString());
} finally {
try {
if (pstmt != null)
pstmt.close();
} catch (SQLException e) {
}
}
return null;
}