]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: lru: fix unconditional call to free due to unexpected semi-colon
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 17:53:03 +0000 (19:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 17:55:32 +0000 (19:55 +0200)
commit7810ad7d597a801b520cd12b182ad67e14388d31
tree346998b6e2f09ae4081a796b12e0eb9819b3fa8d
parent666f5049069e2d05bd31b421f7cffb12545d29af
BUG/MAJOR: lru: fix unconditional call to free due to unexpected semi-colon

Dmitry Sivachenko reported the following build warning using Clang, which
is a real bug :

  src/lru.c:133:32: warning: if statement has empty body [-Wempty-body]
                                  if (old->data && old->free);
                                                             ^
It results in calling old->free(old->data) even when old->free is NULL,
hence crashing on cached patterns.

The same bug appears a few lines below in lru64_destroy() :

  src/lru.c:195:33: warning: if statement has empty body [-Wempty-body]
                          if (elem->data && elem->free);
                                                       ^
Both were introduced in 1.6-dev2 with commit f90ac55 ("MINOR: lru: Add the
possibility to free data when an item is removed"), so no backport is needed.
src/lru.c