Commit fd9f4a2de0e0bb2450a8afeae120a4b14ae10272

Hiltjo Posthuma 2019-08-28T18:45:16

tog: mbs2ws: fix sizeof of element for memory allocation

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tog/tog.c b/tog/tog.c
index fbc6df4..18db590 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -907,7 +907,7 @@ mbs2ws(wchar_t **ws, size_t *wlen, const char *s)
 		}
 	}
 
-	*ws = calloc(*wlen + 1, sizeof(*ws));
+	*ws = calloc(*wlen + 1, sizeof(**ws));
 	if (*ws == NULL) {
 		err = got_error_from_errno("calloc");
 		goto done;