diff options
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index d9ce9028a..40e960a60 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -574,8 +574,9 @@ pwdgrp::add_line (char *eptr) max_lines * pwdgrp_buf_elem_size); } lptr = eptr; - if ((this->*parse) ()) - curr_lines++; + if (!(this->*parse) ()) + return NULL; + curr_lines++; } return eptr; } @@ -1459,18 +1460,18 @@ get_logon_sid () void * pwdgrp::add_account_post_fetch (char *line, bool lock) { + void *ret = NULL; + if (line) { - void *ret; if (lock) pglock.init ("pglock")->acquire (); - add_line (line); - ret = ((char *) pwdgrp_buf) + (curr_lines - 1) * pwdgrp_buf_elem_size; + if (add_line (line)) + ret = ((char *) pwdgrp_buf) + (curr_lines - 1) * pwdgrp_buf_elem_size; if (lock) pglock.release (); - return ret; } - return NULL; + return ret; } void * |