From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNNZx-0002p8-He for qemu-devel@nongnu.org; Tue, 11 Mar 2014 10:22:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNNZn-000370-MY for qemu-devel@nongnu.org; Tue, 11 Mar 2014 10:22:49 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:53738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNNZn-00036q-FG for qemu-devel@nongnu.org; Tue, 11 Mar 2014 10:22:39 -0400 Received: by mail-ea0-f182.google.com with SMTP id b10so4391586eae.27 for ; Tue, 11 Mar 2014 07:22:38 -0700 (PDT) Date: Tue, 11 Mar 2014 15:22:36 +0100 From: Stefan Hajnoczi Message-ID: <20140311142236.GL7761@stefanha-thinkpad.redhat.com> References: <1394436721-21812-1-git-send-email-cyliu@suse.com> <1394436721-21812-13-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394436721-21812-13-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH v22 12/25] qcow2.c: replace QEMUOptionParameter with QemuOpts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: kwolf@redhat.com, Dong Xu Wang , qemu-devel@nongnu.org, stefanha@redhat.com On Mon, Mar 10, 2014 at 03:31:48PM +0800, Chunyan Liu wrote: > @@ -1622,11 +1622,11 @@ out: > return ret; > } > > -static int qcow2_create(const char *filename, QEMUOptionParameter *options, > - Error **errp) > +static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp) > { > - const char *backing_file = NULL; > - const char *backing_fmt = NULL; > + char *backing_file = NULL; > + char *backing_fmt = NULL; > + char *buf; It wouldn't hurt to initialize buf to NULL. That way there is no chance of introducing a bug by jumping to the error path before buf has been initialized. Stefan