]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: fix empty string check for channel path
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 22 Feb 2017 17:18:51 +0000 (17:18 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 23 Feb 2017 10:11:16 +0000 (10:11 +0000)
The libxl code was checking that a 'char *' was != '\0', instead
of checking the first element in the string

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/libxl/libxl_domain.c

index 57ec6611e695236c0bbfa992ae65e9112b5f4d7b..ea28c93345c57488f37402cfedc9396bfd5f723e 100644 (file)
@@ -1121,7 +1121,7 @@ libxlDomainCreateChannelPTY(virDomainDefPtr def, libxl_ctx *ctx)
                                            &channelinfo);
 
         if (!ret && channelinfo.u.pty.path &&
-            channelinfo.u.pty.path != '\0') {
+            *channelinfo.u.pty.path != '\0') {
                 VIR_FREE(chr->source->data.file.path);
                 ignore_value(VIR_STRDUP(chr->source->data.file.path,
                                         channelinfo.u.pty.path));