Merge pull request #630 from ns3777k/578-concurrent-read-write-meta

lock meta mutex during marshaling
This commit is contained in:
evilsocket 2019-09-27 14:01:44 +02:00 committed by GitHub
commit f1ef4bcb35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,8 @@ func NewMeta() *Meta {
} }
func (m *Meta) MarshalJSON() ([]byte, error) { func (m *Meta) MarshalJSON() ([]byte, error) {
m.Lock()
defer m.Unlock()
return json.Marshal(metaJSON{Values: m.m}) return json.Marshal(metaJSON{Values: m.m})
} }