Fix memory errors detected by valgrind and inline functions
[satune.git] / src / Collections / vector.h
index 72e504fa20c537676939fdcf8be295de93468556..76da3873dcc633ca553926c9b1bd36725e88f238 100644 (file)
@@ -29,7 +29,7 @@
                return allocVector ## name(defcap);                                 \
        }                                                                     \
        Vector ## name * allocVector ## name(uint capacity) {                 \
-               Vector ## name * tmp = (Vector ## name *)ourmalloc(sizeof(type));  \
+               Vector ## name * tmp = (Vector ## name *)ourmalloc(sizeof(Vector ## name));  \
                tmp->size = 0;                                                      \
                tmp->capacity = capacity;                                           \
                tmp->array = (type *) ourcalloc(1, sizeof(type) * capacity);          \