perf strbuf: Match va_{add,copy} with va_end
authorSanskriti Sharma <sansharm@redhat.com>
Tue, 2 Oct 2018 14:29:10 +0000 (10:29 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Oct 2018 17:23:44 +0000 (14:23 -0300)
commitce49d8436cffa9b7a6a5f110879d53e89dbc6746
treefe7baef3fda23d62917335853219e7b5dfef9056
parent0e24147d69c9357b1ccb54a9bc028eb9a9f9ed1a
perf strbuf: Match va_{add,copy} with va_end

Ensure that all code paths in strbuf_addv() call va_end() on the
ap_saved copy that was made.

Fixes the following coverity complaint:

  Error: VARARGS (CWE-237): [#def683]
  tools/perf/util/strbuf.c:106: missing_va_end: va_end was not called
  for "ap_saved".

Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Link: http://lkml.kernel.org/r/1538490554-8161-2-git-send-email-sansharm@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/strbuf.c