Merge pull request #2375 from NanXiao/error-handle-in-postContainersCreate

Check r.ParseForm() error in postContainersCreate().
This commit is contained in:
Nishant Totla 2016-07-05 10:17:21 -07:00 committed by GitHub
commit e7b8b4c6eb
1 changed files with 4 additions and 1 deletions

View File

@ -537,7 +537,10 @@ func getContainerJSON(c *context, w http.ResponseWriter, r *http.Request) {
// POST /containers/create
func postContainersCreate(c *context, w http.ResponseWriter, r *http.Request) {
r.ParseForm()
if err := r.ParseForm(); err != nil {
httpError(w, err.Error(), http.StatusBadRequest)
return
}
var (
defaultMemorySwappiness = int64(-1)
name = r.Form.Get("name")