diff mbox

ui: remove check for failure of qemu_acl_init()

Message ID 1430477086-26830-1-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrangé May 1, 2015, 10:44 a.m. UTC
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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 ui/vnc.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Eric Blake May 1, 2015, 12:21 p.m. UTC | #1
On 05/01/2015 04:44 AM, Daniel P. Berrange wrote:
> 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.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  ui/vnc.c | 8 --------
>  1 file changed, 8 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Gerd Hoffmann May 5, 2015, 9:47 a.m. UTC | #2
On Fr, 2015-05-01 at 11:44 +0100, Daniel P. Berrange wrote:
> 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
diff mbox

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index cffb5b7..6bfe228 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -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