Fix memleak in vector_realloc.
This commit is contained in:
parent
e4644f70aa
commit
0b52f40933
|
@ -47,6 +47,7 @@ int vector_realloc(struct vector *v, int capacity)
|
|||
|
||||
v->ptr = new_ptr;
|
||||
} else {
|
||||
free(v->ptr);
|
||||
v->ptr = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue