websock: Don't try to set *errp directly
Assigning directly to *errp is not valid, as errp may be NULL,
&error_fatal, or &error_abort. Use error_propagate() instead.
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170608133906.12737-4-ehabkost@redhat.com>
Reviewed-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 8fabade..5a3badb 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -856,7 +856,7 @@
ssize_t ret;
if (wioc->io_err) {
- *errp = error_copy(wioc->io_err);
+ error_propagate(errp, error_copy(wioc->io_err));
return -1;
}
@@ -902,7 +902,7 @@
ssize_t ret;
if (wioc->io_err) {
- *errp = error_copy(wioc->io_err);
+ error_propagate(errp, error_copy(wioc->io_err));
return -1;
}