********>Bugfix 13:
Author: Junmei Wang, reported by Kazua Ohta
Date: 08/18/06
Programs: Antechamber
Description: The memory allocations for ind_valence and ind_bondnum with malloc
have problems. The size should be atomnum not bondnum. This bug
may cause problems for molecules that have a greater number of
atoms than number of bonds.
Fix: apply the following patch to amber9/src/antechamber/bondtype.C
------------------------------------------------------------------------------
*** bondtype.C 3 Apr 2006 23:34:26 -0000 9.0
--- bondtype.C 18 Aug 2006 21:38:57 -0000
***************
*** 1278,1289 ****
fprintf(stderr, "memory allocation error for *con_num\n");
exit(0);
}
! ind_bondnum = (int *) malloc(sizeof(int) * bondnum);
if (ind_bondnum == NULL) {
fprintf(stderr, "memory allocation error for *ind_bondnum\n");
exit(0);
}
! ind_valence = (int *) malloc(sizeof(int) * bondnum);
if (ind_valence == NULL) {
fprintf(stderr, "memory allocation error for *ind_valence\n");
exit(0);
--- 1278,1289 ----
fprintf(stderr, "memory allocation error for *con_num\n");
exit(0);
}
! ind_bondnum = (int *) malloc(sizeof(int) * atomnum);
if (ind_bondnum == NULL) {
fprintf(stderr, "memory allocation error for *ind_bondnum\n");
exit(0);
}
! ind_valence = (int *) malloc(sizeof(int) * atomnum);
if (ind_valence == NULL) {
fprintf(stderr, "memory allocation error for *ind_valence\n");
exit(0);
------------------------------------------------------------------------------
Temporary workarounds: none