Commit b0980dcfb35fe1c8f783001296b4fea6b7373058

Edward Thomson 2021-07-20T08:25:59

Update src/allocators/stdalloc.c Co-authored-by: lhchavez <lhchavez@lhchavez.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/allocators/stdalloc.c b/src/allocators/stdalloc.c
index 7215468..2b36d9f 100644
--- a/src/allocators/stdalloc.c
+++ b/src/allocators/stdalloc.c
@@ -35,7 +35,7 @@ static void *stdalloc__calloc(size_t nelem, size_t elsize, const char *file, int
 	GIT_UNUSED(line);
 
 #ifdef GIT_DEBUG_STRICT_ALLOC
-	if (!elsize)
+	if (!elsize || !nelem)
 		return NULL;
 #endif