summaryrefslogtreecommitdiffstats
path: root/programs/bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'programs/bench.c')
-rw-r--r--programs/bench.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/programs/bench.c b/programs/bench.c
index e8d89ec..c493682 100644
--- a/programs/bench.c
+++ b/programs/bench.c
@@ -448,7 +448,7 @@ static void BMK_benchFileTable(const char** fileNamesTable, unsigned nbFiles,
if ((U64)benchedSize > totalSizeToLoad) benchedSize = (size_t)totalSizeToLoad;
if (benchedSize < totalSizeToLoad)
DISPLAY("Not enough memory; testing %u MB only...\n", (U32)(benchedSize >> 20));
- srcBuffer = malloc(benchedSize);
+ srcBuffer = malloc(benchedSize + !benchedSize); /* avoid alloc of zero */
if (!srcBuffer) EXM_THROW(12, "not enough memory");
/* Load input buffer */