Fix incorrect free
authorRoland Schulz <roland@utk.edu>
Sat, 6 Oct 2012 22:59:36 +0000 (18:59 -0400)
committerRoland Schulz <roland@utk.edu>
Sat, 6 Oct 2012 22:59:36 +0000 (18:59 -0400)
introduced by 23ca07b5 / 7b6508e8

Change-Id: I713827221923270f8ba94b3ed33ee126f3ce084c

src/mdlib/fft5d.c

index df8d310d2a6dc15f457b9742253da2b27e66e516..9211d148bb8f4ebc92a7e109d4c95f210ec6d560 100644 (file)
@@ -1108,13 +1108,6 @@ llToAll
 void fft5d_destroy(fft5d_plan plan) {
     int s,t;
 
-    /* Note that we expect plan->lin and plan->lout to be freed elsewhere */
-    if (plan->nthreads > 1)
-    {
-        free(plan->lout2);
-        free(plan->lout3);
-    }
-
     for (s=0;s<3;s++)
     {
         if (plan->p1d[s])
@@ -1164,8 +1157,11 @@ void fft5d_destroy(fft5d_plan plan) {
     {
         sfree_aligned(plan->lin);
         sfree_aligned(plan->lout);
-        sfree_aligned(plan->lout2);
-        sfree_aligned(plan->lout3);
+        if (plan->nthreads > 1)
+        {
+            sfree_aligned(plan->lout2);
+            sfree_aligned(plan->lout3);
+        }
     }
     
 #ifdef FFT5D_THREADS