summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2018-04-13 05:33:03 +0200
committerOndrej Fabry <ofabry@cisco.com>2018-04-13 05:33:03 +0200
commit0456d22f67865977065886ed58778621b21b7ede (patch)
tree483e1c4f898574d0b78f681b3b1cdfeccffe2bb3
parente7cec91c8720eddd1ccff3403099b60ee3da0ccd (diff)
Fix missing lock in LookupByID
Change-Id: I699052d179c98ad3a29218fa33fafef0affb97a6 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
-rw-r--r--core/request_handler.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/request_handler.go b/core/request_handler.go
index 7c185cd..27ff4fc 100644
--- a/core/request_handler.go
+++ b/core/request_handler.go
@@ -227,6 +227,9 @@ func (c *Connection) LookupByID(ID uint16) (string, error) {
return "", errors.New("nil connection passed in")
}
+ c.msgIDsLock.Lock()
+ defer c.msgIDsLock.Unlock()
+
for key, id := range c.msgIDs {
if id == ID {
return key, nil