From 48898fbf38b9d1e97f2c662c245714975fc14f86 Mon Sep 17 00:00:00 2001 From: Cenk Alti Date: Wed, 18 Apr 2018 18:00:28 +0300 Subject: [PATCH] add missing error check for duplicate create-close call --- tracker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tracker.go b/tracker.go index 7e99a10..24a3a47 100644 --- a/tracker.go +++ b/tracker.go @@ -296,6 +296,10 @@ func (t *Tracker) createClose(w http.ResponseWriter, r *http.Request) { http.Error(w, "no tempfile found", http.StatusNotFound) return } + if err != nil { + http.Error(w, "duplicate create-close call", http.StatusConflict) + return + } _, err = tx.Exec("delete from tempfile where fid=?", fid) if err != nil { t.internalServerError("cannot delete tempfile", err, r, w)