From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7mjb-0001MO-HD for qemu-devel@nongnu.org; Tue, 31 May 2016 12:41:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7mjX-0004RD-Oo for qemu-devel@nongnu.org; Tue, 31 May 2016 12:41:38 -0400 Received: from resqmta-po-08v.sys.comcast.net ([2001:558:fe16:19:96:114:154:167]:46815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7mjX-0004Qz-JP for qemu-devel@nongnu.org; Tue, 31 May 2016 12:41:35 -0400 From: Eric Blake Date: Tue, 31 May 2016 10:41:27 -0600 Message-Id: <1464712890-14262-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/3] Fix leak in handling of integer lists as strings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com The qapi string-input and string-output visitors can leak memory when used on integer lists that were set up such that the range list needed to merge adjacent/overlapping ranges; detected by valgrind on test-string-{input,output}-visitor. It doesn't hurt that the overall series removes more code than it adds (modulo copyright blurbs) v2: - split out new patch 1 util/range.c, to make code motion easier to follow - address review comments from Markus Eric Blake (3): range: Create range.c for code that should not be inline qapi: Simplify use of range.h qapi: Fix memleak in string visitors on int lists include/qemu/range.h | 91 ++++++++++---------------------------------- qapi/string-input-visitor.c | 17 ++------- qapi/string-output-visitor.c | 4 +- util/range.c | 76 ++++++++++++++++++++++++++++++++++++ util/Makefile.objs | 1 + 5 files changed, 104 insertions(+), 85 deletions(-) create mode 100644 util/range.c -- 2.5.5