qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/46] qemu-option: Tidy up opt_set() not to free arguments o


From: Eric Blake
Subject: Re: [PATCH 15/46] qemu-option: Tidy up opt_set() not to free arguments on failure
Date: Wed, 24 Jun 2020 14:50:49 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/24/20 11:43 AM, Markus Armbruster wrote:
opt_set() frees its argument @value on failure.  Slightly unclean;
functions ideally do nothing on failure.

To tidy this up, move opt_create() from opt_set() into its callers,
along with the cleanup.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
  util/qemu-option.c | 33 ++++++++++++++++++---------------
  1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index 3cdf0c0800..14946e81f2 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -519,36 +519,39 @@ static QemuOpt *opt_create(QemuOpts *opts, const char 
*name, char *value,
      return opt;
  }

Reviewed-by: Eric Blake <eblake@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]