fixed typo in getgroups code
authorAndrew Tridgell <tridge@samba.org>
Mon, 5 Oct 1998 08:42:41 +0000 (08:42 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 5 Oct 1998 08:42:41 +0000 (08:42 +0000)
(This used to be commit 046e8a50219ca69ab326fa672c5fcb1ab3689b3b)

source3/lib/system.c

index 4009e63169b767365f59cc76d6f6e97d0ddf7fdb..deca7e1b6a9b3040bd1b319493f373653df3de2c 100644 (file)
@@ -673,7 +673,9 @@ int sys_getgroups(int setlen, gid_t *gidset)
     return -1;
   } 
 
-  if((group_list = (GID_T *)malloc(setlen * sizoef(GID_T))) == NULL) {
+  if (setlen == 0) setlen = 1;
+
+  if((group_list = (GID_T *)malloc(setlen * sizeof(GID_T))) == NULL) {
     DEBUG(0,("sys_getgroups: Malloc fail.\n"));
     return -1;
   }