diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-10-31 21:52:43 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-10-31 21:52:43 +0200 |
commit | 608c1d180a9e1d132287aacde015dfd0c8fa4953 (patch) | |
tree | b12f74e3a2e0d57b2799f147182834a18f988d86 /io.c | |
parent | e5abd6a16d42fc0f42277919a2d0a2c28476788c (diff) | |
download | egawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.tar.gz egawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.tar.bz2 egawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.zip |
Fix some valgrind errors.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2742,8 +2742,9 @@ init_awkpath(path_info *pi) if (*p == envsep) max_path++; - emalloc(pi->awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath"); - memset(pi->awkpath, 0, (max_path + 1) * sizeof(char *)); + // +3 --> 2 for null entries at front and end of path, 1 for NULL end of list + emalloc(pi->awkpath, char **, (max_path + 3) * sizeof(char *), "init_awkpath"); + memset(pi->awkpath, 0, (max_path + 3) * sizeof(char *)); start = path; i = 0; |