gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / openbabel-fix-crash-on-nwchem-output.patch
1 From 52cea818bf68f8a2d3c48d55d00c2f8b7da25e4c Mon Sep 17 00:00:00 2001
2 From: Daniel Hogan <daniel.hogan@usask.ca>
3 Date: Tue, 28 Mar 2017 22:21:18 -0600
4 Subject: [PATCH] Remove delete statement.
5
6 When from_scratch is true, coordinates is not allocated. A separate if
7 statement was added to handle the case when from_scratch is true that
8 does not try to free coordinates.
9 ---
10 src/formats/nwchemformat.cpp | 9 ++++++---
11 1 file changed, 6 insertions(+), 3 deletions(-)
12
13 diff --git a/src/formats/nwchemformat.cpp b/src/formats/nwchemformat.cpp
14 index 6f625ad5b..79298555f 100644
15 --- a/src/formats/nwchemformat.cpp
16 +++ b/src/formats/nwchemformat.cpp
17 @@ -232,11 +232,14 @@ static const char* OPTIMIZATION_END_PATTERN = " Optimization converged";
18 break;
19 tokenize(vs,buffer);
20 }
21 - if ((from_scratch)||(i != natoms))
22 - {
23 + if (from_scratch)
24 + {
25 + return;
26 + }
27 + if (i != natoms) {
28 delete[] coordinates;
29 return;
30 - }
31 + }
32 molecule->AddConformer(coordinates);
33 }
34