summaryrefslogtreecommitdiff
path: root/lib/imsg-buffer.c
diff options
context:
space:
mode:
authorHung-Weic Chiu <sppsorrg@gmail.com>2017-05-02 00:28:41 +0000
committerHung-Weic Chiu <sppsorrg@gmail.com>2017-05-02 00:33:15 +0000
commit4da93320c7332aaa894c9ec32cff43984adba60d (patch)
treee2b42302e13cdb0f6741a084eebb2c90aec66d52 /lib/imsg-buffer.c
parentc604467a081a332848bf486a207649d79abbe3fd (diff)
Revert "Fix the "Use-after-free" of clang SA."
- This's the wrong way to fix this problem. - Since the "TAILQ_FIRST()" always return diferent pointer as we call "TAILQ_REMOVE()", the clang static analyzer can't detect this behavior. - Ignore this warning and keep files identical to its original one. This reverts commit 5d6cc38ca36538583ff4c464c46a7c6de08608b6. Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
Diffstat (limited to 'lib/imsg-buffer.c')
-rw-r--r--lib/imsg-buffer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/imsg-buffer.c b/lib/imsg-buffer.c
index f7b9f63778..a486fc17c1 100644
--- a/lib/imsg-buffer.c
+++ b/lib/imsg-buffer.c
@@ -209,10 +209,8 @@ msgbuf_clear(struct msgbuf *msgbuf)
{
struct ibuf *buf;
- while ((buf = TAILQ_FIRST(&msgbuf->bufs)) != NULL) {
+ while ((buf = TAILQ_FIRST(&msgbuf->bufs)) != NULL)
ibuf_dequeue(msgbuf, buf);
- TAILQ_FIRST(&msgbuf->bufs) = NULL;
- }
}
int