diff options
author | 2017-08-28 19:41:55 +0000 | |
---|---|---|
committer | 2017-08-28 19:41:55 +0000 | |
commit | cfc51100c36ff261b9e72e4f13d09af5bcfd5963 (patch) | |
tree | 3356223c0dd4fdb347b411b06f6be3a0a72e7138 | |
parent | Put history_write() in line with other functions that walk history (diff) | |
download | wireguard-openbsd-cfc51100c36ff261b9e72e4f13d09af5bcfd5963.tar.xz wireguard-openbsd-cfc51100c36ff261b9e72e4f13d09af5bcfd5963.zip |
Don't bother setting freed history lines to NULL.
Dead code that could send the wrong hint to an unsuspicious reader. The
code should walk use 'history' & 'histptr' to walk the array.
ok millert@, "go for it" tb@
-rw-r--r-- | bin/ksh/history.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 584c8748b85..e0f98e489e7 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.67 2017/08/28 19:39:13 jca Exp $ */ +/* $OpenBSD: history.c,v 1.68 2017/08/28 19:41:55 jca Exp $ */ /* * command history @@ -439,10 +439,8 @@ histreset(void) { char **hp; - for (hp = history; hp <= histptr; hp++) { + for (hp = history; hp <= histptr; hp++) afree(*hp, APERM); - *hp = NULL; - } histptr = history - 1; hist_source->line = 0; @@ -530,10 +528,8 @@ sethistsize(int n) char **hp; offset = n - 1; - for (hp = history; hp < histptr - offset; hp++) { + for (hp = history; hp < histptr - offset; hp++) afree(*hp, APERM); - *hp = NULL; - } memmove(history, histptr - offset, n * sizeof(char *)); } |