diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 97436dd1b..08cc7ea92 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -478,7 +478,7 @@ format_process_root (void *data, char *&destbuf) cfree (destbuf); destbuf = NULL; } - destbuf = p->root (fs); + destbuf = p ? p->root (fs) : NULL; if (!destbuf || !*destbuf) { destbuf = cstrdup (""); diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index bba9ee494..9fe1b3a88 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -884,7 +884,7 @@ char * _pinfo::root (size_t& n) { char *s; - if (!this || !pid) + if (!pid) return NULL; if (pid != myself->pid && !ISSTATE (this, PID_NOTCYGWIN)) {