Received: from eggs.gnu.org ([208.118.235.92]:36376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvVW0-0000PB-Ru for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvVVv-0001lz-IN for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:07:00 -0500 From: Markus Armbruster References: <1358346998-26328-1-git-send-email-armbru@redhat.com> <1358346998-26328-9-git-send-email-armbru@redhat.com> <50F6CCE1.4020503@redhat.com> Date: Wed, 16 Jan 2013 17:06:53 +0100 In-Reply-To: <50F6CCE1.4020503@redhat.com> (Eric Blake's message of "Wed, 16 Jan 2013 08:53:05 -0700") Message-ID: <87a9s9jen6.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 08/11] qemu-log: Plug trivial memory leak in cpu_set_log_filename() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Eric Blake writes: > On 01/16/2013 07:36 AM, Markus Armbruster wrote: >> Signed-off-by: Markus Armbruster >> --- >> qemu-log.c | 13 +++++++++---- >> 1 file changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/qemu-log.c b/qemu-log.c >> index 64a1b88..1eadf1b 100644 >> --- a/qemu-log.c >> +++ b/qemu-log.c >> @@ -21,10 +21,12 @@ >> #include "qemu/log.h" >> >> #ifdef WIN32 >> -static const char *logfilename = "qemu.log"; >> +#define DEFAULT_LOGFILENAME = "qemu.log" > > Syntax error. How embarrassing. Unfortunately, it compiles... I'll respin. >> @@ -54,11 +56,13 @@ void qemu_log_mask(int mask, const char *fmt, ...) >> /* enable or disable low levels log */ >> void qemu_set_log(int log_flags, bool use_own_buffers) >> { >> + const char *fname = logfilename ?: DEFAULT_LOGFILENAME; > > ?: is not C99, but a GNU extension. What is our policy on using it? We got several dozen instancess of ?: spread over the tree.