Fix a bug in r265255: only return NULL if the requested map wasn't found.

Submitted by:	Luke Chang-Hsien Tsai <luke.tw@gmail.com>
MFC after:	1 week
This commit is contained in:
Mark Johnston 2014-08-24 17:02:27 +00:00
parent 36fb8bfcd3
commit 24a08d303e

View File

@ -121,10 +121,12 @@ proc_obj2map(struct proc_handle *p, const char *objname)
break;
}
}
if (rdl == NULL && strcmp(objname, "a.out") == 0 && p->rdexec != NULL)
rdl = p->rdexec;
else
return (NULL);
if (rdl == NULL) {
if (strcmp(objname, "a.out") == 0 && p->rdexec != NULL)
rdl = p->rdexec;
else
return (NULL);
}
if ((map = malloc(sizeof(*map))) == NULL)
return (NULL);