summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/repo.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 4bb5e3eb01..ac9efaf7a1 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1619,6 +1619,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
}
if err = sess.Commit(); err != nil {
+ sess.Close()
if len(deployKeys) > 0 {
// We need to rewrite the public keys because the commit failed
if err2 := RewriteAllPublicKeys(); err2 != nil {