ESH

Executive Shell
git clone http://git.omkov.net/ESH
Log | Tree | Refs | README | Download

AuthorJamozed <[email protected]>
Date2021-11-22 10:58:26
Commit3cb5034f56e2538fe7e9ff0b92bd865221c4d83f
Parent2144355beea4bd8b25f8a45384eb1d664ed11d26

Fix valgrind uninitialised memory warning

Diffstat

M src/lineread.c | 2 +-

1 files changed, 1 insertions, 1 deletions

diff --git a/src/lineread.c b/src/lineread.c
index c1440d3..1f6187b 100644
--- a/src/lineread.c
+++ b/src/lineread.c
@@ -376,7 +376,7 @@ static void line_delete_end(struct line *l) {
 /* Initialise history */
 static int hist_init(struct hist *h) {
 	h->ap = 0; h->ah = 0; h->at = 0; h->al = 0; h->ac = conf_histsize + 1;
-	if (!(h->a = malloc(h->ac * sizeof (*h->a)))) { return 1; }
+	if (!(h->a = assert_calloc(h->ac, sizeof (*h->a)))) { return 1; }
 	/* TODO load history from file */ return 0;
 }