Skip to content

Commit e86f052

Browse files
committed
fix:leaky st
1 parent 866739e commit e86f052

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • JavaSecurity/CodeReview/JavaSec-Code/MybatiSqli/src/main/java/com/drunkbaby/controller

JavaSecurity/CodeReview/JavaSec-Code/MybatiSqli/src/main/java/com/drunkbaby/controller/SQLI.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,17 @@ public String jdbc_sqli_sec(@RequestParam("username") String username) {
120120
logger.info(info);
121121
}
122122

123-
rs.close();
124-
con.close();
123+
125124

126125
} catch (ClassNotFoundException e) {
127126
logger.error("Sorry, can`t find the Driver!");
128127
e.printStackTrace();
129128
} catch (SQLException e) {
130129
logger.error(e.toString());
130+
} finally {
131+
st.close();
132+
rs.close();
133+
con.close();
131134
}
132135
return result.toString();
133136
}

0 commit comments

Comments
 (0)