diff --git a/src/sprs.c b/src/sprs.c index 1166d5a..ef1271a 100644 --- a/src/sprs.c +++ b/src/sprs.c @@ -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;