diff --git a/frontend/page_album_detail.go b/frontend/page_album_detail.go
index cc96f195af774f2aceae8c3f7bac3b8a41e0c0c4..b7f3fb9137c6eda7f6c475981c05eeca81f70c31 100644
--- a/frontend/page_album_detail.go
+++ b/frontend/page_album_detail.go
@@ -31,6 +31,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler {
 			formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
 			return
 		}
+		defer result.Close()
 
 		var info shared.Album
 		if result.Next() {
@@ -51,6 +52,7 @@ func pageAlbumDetail(env PageEnvironment) http.Handler {
 			WHERE album = $1
 			ORDER BY position
 			`, albumId)
+			defer result.Close()
 			if err != nil {
 				formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
 				return
diff --git a/frontend/page_image_detail.go b/frontend/page_image_detail.go
index 97f59ad159cc0fa7cdae53f39f9651da6cd95649..5b85524eb82c952632a54ab447d7e6b83d892e2d 100644
--- a/frontend/page_image_detail.go
+++ b/frontend/page_image_detail.go
@@ -37,6 +37,7 @@ func pageImageDetail(env PageEnvironment) http.Handler {
 			formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
 			return
 		}
+		defer result.Close()
 
 		var info shared.Image
 
diff --git a/frontend/page_image_list.go b/frontend/page_image_list.go
index 583e3deebb45b5947280bc9b3d011e1796d0826a..10e7ff868faa9eee92c1caf029327f0ce74a7987 100644
--- a/frontend/page_image_list.go
+++ b/frontend/page_image_list.go
@@ -71,6 +71,7 @@ func pageImageList(ctx PageEnvironment) http.Handler {
 			formatError(w, ErrorData{http.StatusInternalServerError, user, r.URL, err}, "html")
 			return
 		}
+		defer result.Close()
 
 		var images []shared.Image
 		for result.Next() {