basicfuncs: Fix a think-o

When parsing a number, during any of the numeric template functions, and
the parse fails, display the error message correctly. Previously, the
same error message was displayed for both the first and the second
argument, and both messages said "first argument".

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Fix the memory leak problem for mutex

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Tusa Viktor <tusa@balabit.hu>
Fix the memory leak problem when HAVE_ENVIRON is defined

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Tusa Viktor <tusavik@gmail.com>
rewrite-expr-grammar.ym: Free up token.

Reported-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Viktor Tusa <tusavik@gmail.com>
template.c: Free entire template item list, not just the last item.

Reported-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Viktor Tusa <tusavik@gmail.com>
Merge branch 'f/memory-leak-fixes' into 3.5/master

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Revert "Fix the memory leak problem when HAVE_ENVIRON is defined"

This reverts commit b0f621fbeabc760be9d74bb1c3d3dd6134145ff9.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
ValuePairs: fixed some memory leak

  * free all the content of the g_ptr_array, not just the array itself
    (Viktor Tusa fixed it in 3.6)
  * free the g_ptr_array() when failed to split the vp names
    (found by Balazs Scheidler)
Merge pull request #126 from lmesz/3.5/master

ValuePairs: free the content of the value-pairs array not just the array...
libtest: Install the library, headers and pkg-config file

This opens up the possibility of using the testing framework in external
modules, too.

Requested-by: Viktor Tusa <tusavik@gmail.com>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #133 from algernon/f/libtest-install

libtest: Install the library, headers and pkg-config file
Install internal ivykis headers when necessary

When building with an internal ivykis, and it gets linked into
libsyslog-ng, install the headers to ${pkgincludedir}/ivykis, adjust the
CFLAGS in the pkg-config control file accordingly, and note the fact
with an "ivykis=internal" entry in the same file.

This makes it possible to not only detect a syslog-ng with an embedded
ivykis, but to build against such a thing, too. This fixes #124.

Requested-by: Viktor Tusa <tusavik@gmail.com>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #135 from algernon/f/3.5/internal-ivykis-install

Install internal ivykis headers when necessary
lib/Makefile.am: Uninstall ivykis headers when needed

When we installed the ivykis headers (if using the internal ivykis), we
should uninstall them too. This hooks up an uninstall hook that does
just that.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #136 from algernon/f/3.5/internal-ivykis-install

lib/Makefile.am: Uninstall ivykis headers when needed
value-pairs: the DATE should always contain the stamp time

Formerly it contained sometimes the stamp time and sometimes the
received time. From now it will always contain the stamp time.

Signed-off-by: Daniel Gados <gdani@balabit.hu>
value-pairs: adding sdata to the syslog-proto (RFC5424) scope

Signed-off-by: Daniel Gados <gdani@balabit.hu>
value-pairs: the key option of value-pairs is expanded to macros

Formerly it was expaned only to nvtable entries, but from now it
expands to macros as well without setting the scope.

Signed-off-by: Daniel Gados <gdani@balabit.hu>
format-json: fixing that the SEQNUM macro does not expand

Signed-off-by: Daniel Gados <gdani@balabit.hu>
json: Fix the format-json test

While cherry picking the patch from master worked, 3.5 does not have
RCPTID, so remove that from the test case, to make it pass.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>