From: Lucas K Date: Wed, 23 Dec 2020 18:28:08 +0000 (-0800) Subject: fixed free() pointer error that was throwing segfaults on newer systems X-Git-Url: https://s3miclassical.com/gitweb/?a=commitdiff_plain;h=f149e87354b31a8e638102aca3fc599552370cf4;p=strong_simulation_stabilizer_rank.git fixed free() pointer error that was throwing segfaults on newer systems --- diff --git a/exponentialsum.c b/exponentialsum.c index 0e0bd6e..cbf58d9 100644 --- a/exponentialsum.c +++ b/exponentialsum.c @@ -251,8 +251,9 @@ complex double exponentialsum(int *k, int *Q, int *D, int **J) { setWalker = setE; // 'a'=setE->data while(setWalker != NULL) { if(setWalker->next->data == setK->data) { - free(setWalker->next); + setWalker2 = setWalker->next; setWalker->next = setWalker->next->next; // delete 'b' + free(setWalker2); break; } setWalker = setWalker->next;