Print this page
10116 mech_dh needs smatch fixes

@@ -24,11 +24,13 @@
  *
  *      Copyright (c) 1997, by Sun Microsystems, Inc.
  *      All rights reserved.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
 
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
 #include <dh_gssapi.h>

@@ -102,11 +104,11 @@
         static int init_nis_pubkey = 0;
         static int (*nis_call)();
         static const char NIS_SYMBOL[] = "__rpcsec_gss_is_server";
 
         if (!init_nis_pubkey) {
-                mutex_lock(&init_nis_pubkey_lock);
+                (void) mutex_lock(&init_nis_pubkey_lock);
                 if (!init_nis_pubkey) {
                         void *dlhandle = dlopen(0, RTLD_NOLOAD);
                         if (dlhandle == 0) {
                                 syslog(LOG_ERR, "dh: Could not dlopen "
                                     "in dh_getpublickey for %s. "

@@ -115,11 +117,11 @@
                                 nis_call = (int (*)())
                                         dlsym(dlhandle, NIS_SYMBOL);
                         }
                         init_nis_pubkey = 1;
                 }
-                mutex_unlock(&init_nis_pubkey_lock);
+                (void) mutex_unlock(&init_nis_pubkey_lock);
         }
         if (nis_call && (*nis_call)()) {
                 int key_cached;
                 return (__getpublickey_cached_g(remote, keylen, algtype,
                                             pk, pklen, &key_cached));