diff options
-rw-r--r-- | usr.bin/less/line.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/less/line.c b/usr.bin/less/line.c index 629402d4c29..42d1a24502b 100644 --- a/usr.bin/less/line.c +++ b/usr.bin/less/line.c @@ -94,8 +94,8 @@ expand_linebuf(void) int new_size = size_linebuf * 2; /* Just realloc to expand the buffer, if we can. */ - char *new_buf = realloc(linebuf, new_size); - char *new_attr = realloc(attr, new_size); + char *new_buf = recallocarray(linebuf, size_linebuf, new_size, 1); + char *new_attr = recallocarray(attr, size_linebuf, new_size, 1); if (new_buf == NULL || new_attr == NULL) { free(new_attr); free(new_buf); |