object-add: don't create return value if failed
commit7f5d9b206d1e86425faa5b84b551068bf044b823
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Mar 2020 09:41:21 +0000 (26 10:41 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Apr 2020 18:56:10 +0000 (2 14:56 -0400)
treeff9185f720d36830ce74909068f0a17d2c2dd586
parentb3fbb328123575e5b39e35e13ecbd4927569a82b
object-add: don't create return value if failed

No need to return an empty value from object-add (it would also leak
if the command failed).  While at it, remove the "if" around object_unref
since object_unref handles NULL arguments just fine.

Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200325184723.2029630-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom/qom-qmp-cmds.c