diff src/jdk.security.auth/unix/native/libjaas/Unix.c @ 51120:dccdf51b10dd

8207233: Minor improvements of jdk C-coding Reviewed-by: rriggs, prr
author goetz
date Fri, 13 Jul 2018 17:42:24 +0200
parents 71c04702a3d5
children
line wrap: on
line diff
--- a/src/jdk.security.auth/unix/native/libjaas/Unix.c	Fri Jul 13 13:00:36 2018 -0700
+++ b/src/jdk.security.auth/unix/native/libjaas/Unix.c	Fri Jul 13 17:42:24 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,9 @@
     jclass cls;
 
     numSuppGroups = getgroups(0, NULL);
+    if (numSuppGroups == -1) {
+        return;
+    }
     groups = (gid_t *)calloc(numSuppGroups, sizeof(gid_t));
     if (groups == NULL) {
         jclass cls = (*env)->FindClass(env,"java/lang/OutOfMemoryError");