@@ -642,7 +642,7 @@ int hogvm(long long forks, long long chunks, long long bytes)
usleep(backoff);
while (1) {
- ptr = (char **)malloc(chunks * 2);
+ ptr = (char **)malloc(chunks * 2 * sizeof(char *));
for (j = 0; chunks == 0 || j < chunks; j++) {
if ((ptr[j] =
(char *)malloc(bytes *
@@ -642,7 +642,7 @@ int hogvm(long long forks, long long chunks, long long bytes)
usleep(backoff);
while (1) {
- ptr = (char **)malloc(chunks * 2);
+ ptr = (char **)malloc(chunks * 2 * sizeof(char *));
for (j = 0; chunks == 0 || j < chunks; j++) {
if ((ptr[j] =
(char *)malloc(bytes *