From a04490cbdd30915ac6744e918e610d46f31960dc Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 5 May 2017 19:48:23 -0700 Subject: [PATCH] Fix bug that would cause a double free if setup files and free is called --- src/sprs.c | 2 ++ 1 file changed, 2 insertions(+) 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;