Fix data race in client setConfig()/randomizeURL()

pull/2445/head
Jason Wilder 2015-04-27 23:12:14 -07:00
parent c7f0ccf443
commit a3013009aa
1 changed files with 3 additions and 0 deletions

View File

@ -223,6 +223,9 @@ func (c *Client) loadConfig() error {
// setConfig writes a new config to disk and updates urls on the client.
func (c *Client) setConfig(config ClientConfig) error {
c.mu.Lock()
defer c.mu.Unlock()
// Only write to disk if we have a path.
if c.path != "" {
// Open config file for writing.