[WebServer] fixed potential memory leak