Skip to contentSkip to conversation

ui: remove check for failure of qemu_acl_init()

PATCH In review Daniel P. Berrange 3 participants 3 messages May 1, 2015 – May 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui: remove check for failure of qemu_acl_init()

The qemu_acl_init() function has long since stopped being able to return NULL, since g_malloc will abort on OOM. As such the checks for NULL were unreachable code.

---
 ui/vnc.c | 8 --------
 1 file changed, 8 deletions(-)
ui/vnc.c +0 -8
index cffb5b7..6bfe228 100644
@@ -3602,10 +3602,6 @@ void vnc_display_open(const char *id, Error **errp)
             aclname = g_strdup_printf("vnc.%s.x509dname", vs->id);
         }
         vs->tls.acl = qemu_acl_init(aclname);
-        if (!vs->tls.acl) {
-            fprintf(stderr, "Failed to create x509 dname ACL\n");
-            exit(1);
-        }
         g_free(aclname);
     }
 #endif
@@ -3619,10 +3615,6 @@ void vnc_display_open(const char *id, Error **errp)
             aclname = g_strdup_printf("vnc.%s.username", vs->id);
         }
         vs->sasl.acl = qemu_acl_init(aclname);
-        if (!vs->sasl.acl) {
-            fprintf(stderr, "Failed to create username ACL\n");
-            exit(1);
-        }
         g_free(aclname);
     }
 #endif
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Daniel P. Berrange

The qemu_acl_init() function has long since stopped being able to return NULL, since g_malloc will abort on OOM. As such the checks for NULL were unreachable code.

---
 ui/vnc.c | 8 --------
 1 file changed, 8 deletions(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
In reply to Daniel P. Berrange
Quoted 3 lines · Daniel P. Berrange

The qemu_acl_init() function has long since stopped being able to return NULL, since g_malloc will abort on OOM. As such the checks for NULL were unreachable code.

added to vnc queue.

thanks,
Gerd