Fix bug that would cause a double free if setup files and free is called
This commit is contained in:
parent
1a7ba8e393
commit
a04490cbdd
|
@ -14,6 +14,8 @@ libds_result sprs_setup(sprs* sprs, int size){
|
|||
if(sprs->sparse == NULL || sprs->dense == NULL){
|
||||
free(sprs->sparse);
|
||||
free(sprs->dense);
|
||||
sprs->sparse = NULL;
|
||||
sprs->dense = NULL;
|
||||
result = LIBDS_MALLOC;
|
||||
} else {
|
||||
sprs->capacity = size;
|
||||
|
|
Loading…
Reference in New Issue
Block a user