]> source.dussan.org Git - gitea.git/commitdiff
fix u2f registrationlist ToRegistrations() method (#6980)
authorDavid Schneiderbauer <daviian@users.noreply.github.com>
Sat, 18 May 2019 13:40:05 +0000 (15:40 +0200)
committerzeripath <art27@cantab.net>
Sat, 18 May 2019 13:40:05 +0000 (14:40 +0100)
models/u2f.go

index 200d417fcc41a44faf80198479a4f4968f303a8f..1224b4a5fbed9f6e84380096746d32693e40ba68 100644 (file)
@@ -48,7 +48,7 @@ type U2FRegistrationList []*U2FRegistration
 
 // ToRegistrations will convert all U2FRegistrations to u2f.Registrations
 func (list U2FRegistrationList) ToRegistrations() []u2f.Registration {
-       regs := make([]u2f.Registration, len(list))
+       regs := make([]u2f.Registration, 0, len(list))
        for _, reg := range list {
                r, err := reg.Parse()
                if err != nil {