Skip to content

Commit

Permalink
add missing error check for duplicate create-close call
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Apr 18, 2018
1 parent cafc137 commit 48898fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 48898fb

Please sign in to comment.