about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2014-05-23 10:21:32 +0000
committerEric Wong <e@80x24.org>2014-05-30 22:12:31 +0000
commit446a21c9ac664f7456e2e4e739979baab8ba13c1 (patch)
treec14bf9314fdb1e26ed5e306df81cf36c5c9dde03
parentc53cecda7106e4c7eb14d5c26e28bda82743771d (diff)
downloadcmogstored-446a21c9ac664f7456e2e4e739979baab8ba13c1.tar.gz
We do not need to be holding devstats_lock when releasing
a local buffer which will never be used by another thread.
-rw-r--r--svc_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/svc_dev.c b/svc_dev.c
index bb83128..393feeb 100644
--- a/svc_dev.c
+++ b/svc_dev.c
@@ -246,10 +246,10 @@ bool mog_svc_devstats_broadcast(void *ent, void *ignored)
                 }
         }
 out:
-        free(buf);
-
         CHECK(int, 0, pthread_mutex_unlock(&svc->devstats_lock));
 
+        free(buf);
+
         return true;
 }