Message ID | 20180221135404.27598-19-kwolf@redhat.com |
---|---|
State | New |
Headers | show |
Series | x-blockdev-create for protocols and qcow2 | expand |
On 2018-02-21 14:53, Kevin Wolf wrote: > If we want to include the invalid option name in the error message, we > can't free the string earlier than that. > > Signed-off-by: Kevin Wolf <kwolf@redhat.com> > --- > block/rbd.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz <mreitz@redhat.com>
On 02/21/2018 07:53 AM, Kevin Wolf wrote: > If we want to include the invalid option name in the error message, we > can't free the string earlier than that. > > Signed-off-by: Kevin Wolf <kwolf@redhat.com> > --- > block/rbd.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) D'oh. Should this one be cc'd to qemu-stable? Reviewed-by: Eric Blake <eblake@redhat.com>
Am 23.02.2018 um 16:15 hat Eric Blake geschrieben: > On 02/21/2018 07:53 AM, Kevin Wolf wrote: > > If we want to include the invalid option name in the error message, we > > can't free the string earlier than that. > > > > Signed-off-by: Kevin Wolf <kwolf@redhat.com> > > --- > > block/rbd.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > D'oh. Should this one be cc'd to qemu-stable? Yes, good point. Adding the CC to this reply, and also adding a Cc: line in the commit message. Kevin
diff --git a/block/rbd.c b/block/rbd.c index 8474b0ba11..27fa11b473 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -268,13 +268,14 @@ static int qemu_rbd_set_keypairs(rados_t cluster, const char *keypairs_json, key = qstring_get_str(name); ret = rados_conf_set(cluster, key, qstring_get_str(value)); - QDECREF(name); QDECREF(value); if (ret < 0) { error_setg_errno(errp, -ret, "invalid conf option %s", key); + QDECREF(name); ret = -EINVAL; break; } + QDECREF(name); } QDECREF(keypairs);
If we want to include the invalid option name in the error message, we can't free the string earlier than that. Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/rbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)