diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:01:20 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:01:20 +0000 |
commit | 3139a6b754aa5d477fc3624d52fdcdc994dfecb8 (patch) | |
tree | bd2f0ed2de572bc446f82bcfe88fd85ea3a957f2 /bin/ps/keyword.c | |
parent | fba43388876fa45b6e42ad3758824ac1cfce9c9a (diff) | |
download | FreeBSD-src-3139a6b754aa5d477fc3624d52fdcdc994dfecb8.zip FreeBSD-src-3139a6b754aa5d477fc3624d52fdcdc994dfecb8.tar.gz |
Duplicate the pointer to the string containing the header so it does not get
frobbed when/if the pointer it is actually a part of gets freed.
Diffstat (limited to 'bin/ps/keyword.c')
-rw-r--r-- | bin/ps/keyword.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index e1ff7ba..0e4241a 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -285,7 +285,7 @@ findvar(char *p) warnx("%s: keyword not found", p); eval = 1; } else if (hp) - v->header = hp; + v->header = strdup(hp); return (v); } |