diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLAuthenticationData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index 5030c1d..fef582e 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |||
@@ -77,30 +77,32 @@ namespace OpenSim.Data.MySQL | |||
77 | { | 77 | { |
78 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 78 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); |
79 | 79 | ||
80 | IDataReader result = cmd.ExecuteReader(); | 80 | using(IDataReader result = cmd.ExecuteReader()) |
81 | |||
82 | if (result.Read()) | ||
83 | { | 81 | { |
84 | ret.PrincipalID = principalID; | 82 | if(result.Read()) |
83 | { | ||
84 | ret.PrincipalID = principalID; | ||
85 | 85 | ||
86 | CheckColumnNames(result); | 86 | CheckColumnNames(result); |
87 | 87 | ||
88 | foreach (string s in m_ColumnNames) | 88 | foreach(string s in m_ColumnNames) |
89 | { | 89 | { |
90 | if (s == "UUID") | 90 | if(s == "UUID") |
91 | continue; | 91 | continue; |
92 | 92 | ||
93 | ret.Data[s] = result[s].ToString(); | 93 | ret.Data[s] = result[s].ToString(); |
94 | } | 94 | } |
95 | 95 | ||
96 | return ret; | 96 | dbcon.Close(); |
97 | } | 97 | return ret; |
98 | else | 98 | } |
99 | { | 99 | else |
100 | return null; | 100 | { |
101 | dbcon.Close(); | ||
102 | return null; | ||
103 | } | ||
101 | } | 104 | } |
102 | } | 105 | } |
103 | dbcon.Close(); | ||
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||