nsswitch: Fix CID 1441072 Error handling issues (CHECKED_RETURN)
authorRalph Wuerthner <ralph.wuerthner@de.ibm.com>
Fri, 9 Nov 2018 07:58:31 +0000 (08:58 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 9 Nov 2018 21:42:27 +0000 (22:42 +0100)
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
nsswitch/stress-nss-libwbclient.c

index cf85ff3f8174348b2dbda9be7d6a9c6182fcac37..740ad0e90fa131fb67fad748d3e488a5bd0a4dfb 100644 (file)
@@ -118,7 +118,13 @@ int main(int argc, char *argv[])
 
        state.username = argv[1];
        state.timeout = time(NULL) + RUNTIME;
-       pthread_mutex_init(&state.lock, NULL);
+       rc = pthread_mutex_init(&state.lock, NULL);
+       if (rc != 0) {
+               fprintf(stderr,
+                       "pthread_mutex_init failed: %s\n",
+                       strerror(rc));
+               exit(1);
+       }
        state.fail = false;
        state.nss_loop_count = 0;
        state.wbc_loop_count = 0;