Skip to content

Display and control your Android device

Use reallocarray() in sc_vector

Romain Vimontc735b8c127bb
diff --git a/app/src/util/vector.h b/app/src/util/vector.h
index 0c6cab98..97d7c389 100644
--- a/app/src/util/vector.h
+++ b/app/src/util/vector.h
@@ -118,7 +118,7 @@ static inline void *
sc_vector_reallocdata_(void *ptr, size_t count, size_t size,
size_t *restrict pcap, size_t *restrict psize)
{
- void *p = realloc(ptr, count * size);
+ void *p = reallocarray(ptr, count, size);
if (!p) {
return NULL;
}