diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2019-07-22 18:27:17 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2019-07-22 18:27:17 +0000 |
| commit | 41fc64c259fc338ccbdddd9f730440f40fce6767 (patch) | |
| tree | 54be927a5be90ce840bbe3aaf34c144bae6666ba | |
| parent | f1903dc0550e4cd857e6ae2cabe135a6c59d39dc (diff) | |
Notes
| -rw-r--r-- | lib/libproc/proc_sym.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c index 5901379b1582c..c3a84a9403a20 100644 --- a/lib/libproc/proc_sym.c +++ b/lib/libproc/proc_sym.c @@ -559,10 +559,11 @@ _proc_name2map(struct proc_handle *p, const char *name) } /* If we didn't find a match, try matching prefixes of the basename. */ for (i = 0; i < p->nmappings; i++) { - strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); + mapping = &p->mappings[i]; + strlcpy(path, mapping->map.pr_mapname, sizeof(path)); base = basename(path); if (strncmp(base, name, len) == 0) - return (&p->mappings[i]); + return (mapping); } if (strcmp(name, "a.out") == 0) return (_proc_addr2map(p, |
