]> granicus.if.org Git - haveged/commitdiff
fix segv at start
authorAndrew <16061801+brada4@users.noreply.github.com>
Fri, 15 Mar 2019 09:17:40 +0000 (11:17 +0200)
committerAndrew <16061801+brada4@users.noreply.github.com>
Fri, 15 Mar 2019 09:17:40 +0000 (11:17 +0200)
src/havege.c

index 43cac70d15046b7fb921980a75213cc4e3bf5a54..3c4508b730717715d3447c62351b0a894ea811f2 100644 (file)
@@ -197,12 +197,12 @@ void havege_destroy(       /* RETURN: none            */
          free(temp);
          }
 #ifdef ONLINE_TESTS_ENABLE
-      if (0 != (temp=hptr->testData)) {
+      else if (0 != (temp=hptr->testData)) {
          double *g = ((procShared *)temp)->G;
          hptr->testData = 0;
-         if (0 != g)
-            free(g);
          }
+      if (0 != g)
+         free(g);
 #endif
       if (0 != (htemp=hptr->collector)) {
          hptr->collector = 0;