common: fix incorrect comparison
PATCH 1/1 common: fix incorrect comparison
The variable n, which is of type size_t and cannot have negative values, is checked for a negative value in dlmalloc.c:2107.
Signed-off-by Maks Mishin <[email protected]>
--- common/dlmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/dlmalloc.c +1 -1
@@ -2104,7 +2104,7 @@ Void_t* cALLOc_impl(n, elem_size) size_t n; size_t elem_size;#endif Void_t * mem =mALLOc_impl (sz); -if ((long )n <0 )return NULL ; +if ((long )n <=0 )return NULL ;if (mem ==NULL )return NULL ;
Signature · 1 line
2.34.1