Received: from eggs.gnu.org ([2001:4830:134:3::10]:53173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxb3N-0001D3-Nk for qemu-devel@nongnu.org; Wed, 05 Sep 2018 12:53:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxb3J-0003L8-Oi for qemu-devel@nongnu.org; Wed, 05 Sep 2018 12:53:17 -0400 From: Alberto Garcia In-Reply-To: References: Date: Wed, 05 Sep 2018 18:53:09 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 08/10] block: Allow changing 'discard' on reopen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Max Reitz , Kevin Wolf On Mon 03 Sep 2018 04:34:06 PM CEST, Alberto Garcia wrote: > + value = qemu_opt_get_del(opts, "discard"); > + if (value != NULL) { > + if (bdrv_parse_discard_flags(value, &reopen_state->flags) != 0) { > + error_setg(errp, "Invalid discard option"); > + ret = -EINVAL; > + goto error; > + } > + } I just realized that we're leaking the string here. qemu_opt_get_del() expects that the returned value is freed by the caller. I'll correct all the patches from this series with this problem and resend the series. Berto