unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 879df026a169462abe5d0d9e3ab060a9fcb72f67 1037 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
From 52cea818bf68f8a2d3c48d55d00c2f8b7da25e4c Mon Sep 17 00:00:00 2001
From: Daniel Hogan <daniel.hogan@usask.ca>
Date: Tue, 28 Mar 2017 22:21:18 -0600
Subject: [PATCH] Remove delete statement.

When from_scratch is true, coordinates is not allocated. A separate if
statement was added to handle the case when from_scratch is true that
does not try to free coordinates.
---
 src/formats/nwchemformat.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/formats/nwchemformat.cpp b/src/formats/nwchemformat.cpp
index 6f625ad5b..79298555f 100644
--- a/src/formats/nwchemformat.cpp
+++ b/src/formats/nwchemformat.cpp
@@ -232,11 +232,14 @@ static const char* OPTIMIZATION_END_PATTERN = "  Optimization converged";
           break;
         tokenize(vs,buffer);
     }
-    if ((from_scratch)||(i != natoms))
-      {
+    if (from_scratch) 
+    {
+        return;
+    }
+    if (i != natoms) {
         delete[] coordinates;
         return;
-      }
+    }
     molecule->AddConformer(coordinates);
   }
 

debug log:

solving 879df026a1 ...
found 879df026a1 in https://git.savannah.gnu.org/cgit/guix.git

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).