Removed srenew that was making array smaller incorrectly.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Wed, 23 Mar 2016 13:04:00 +0000 (14:04 +0100)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Wed, 23 Mar 2016 13:36:00 +0000 (14:36 +0100)
An array y was first allocated to 6 entries, then reduced
to 3 entries using srenew, but after that the indices
3, 4 and 5 were used anyway. Removing the srenew fixes the probem.

Fixes #1920

Change-Id: I3f35f0af3f56d33435bf54a9c7cda6273fb3f05a

src/gromacs/gmxana/gmx_dielectric.c

index 6e76ed186cb5edaf200fb12997a87f227dc0fc64..944e5871925ee702b9faeaf8a8db68c5614e16d4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -366,7 +366,6 @@ int gmx_dielectric(int argc, char *argv[])
     if (ny == 2)
     {
         printf("Creating standard deviation numbers ...\n");
-        srenew(y, 3);
         snew(y[2], nx);
 
         fac = 1.0/((real)nx);