Print this page
10124 smatch fixes for cryptoadm

@@ -21,10 +21,11 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright (c) 2018, Joyent, Inc.
  */
 
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>

@@ -264,10 +265,11 @@
         }
 
         if ((fd = open(ADMIN_IOCTL_DEVICE, O_RDONLY)) == -1) {
                 cryptoerror(LOG_STDERR, gettext("failed to open %s: %s"),
                     ADMIN_IOCTL_DEVICE, strerror(errno));
+                free(pdevlist);
                 return (FAILURE);
         }
 
         pdevlist->dl_dev_count = count;
         if (ioctl(fd, CRYPTO_GET_DEV_LIST, pdevlist) == -1) {