From a3013009aa2f2196200a7b8c3ee899cbc89fbfb7 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Mon, 27 Apr 2015 23:12:14 -0700 Subject: [PATCH] Fix data race in client setConfig()/randomizeURL() --- messaging/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/messaging/client.go b/messaging/client.go index 5e6f3a4a12..26b91fbaf6 100644 --- a/messaging/client.go +++ b/messaging/client.go @@ -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.