--- pam_chroot-0.9.1/pam_chroot.c.orig 2007-07-24 23:04:09.000000000 +0300 +++ pam_chroot-0.9.1/pam_chroot.c 2007-07-24 23:00:52.000000000 +0300 @@ -291,7 +291,7 @@ if(NULL == grp) { _pam_log(LOG_DEBUG, "%s: no grnam for gid %d", opts->module, gids[i]); snprintf(scratch, SCRATCH, "%d", gids[i]); - groups[i] = x_strdup(scratch); + groups[i] = (scratch[0]) ? strdup(scratch):NULL; } else { groups[i] = x_strdup(grp->gr_name); }