From d2feec238154abc11a0ac671fb5043b3fa6fafe5 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Thu, 17 Oct 2013 15:55:04 +0200 Subject: Do not use molecule pointer when allocing for bonds. diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index fac759f..516ad86 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -2455,8 +2455,8 @@ static tng_function_status tng_molecules_block_read if(molecule->n_bonds > 0) { - molecule->bonds = malloc(molecule->n_bonds * - sizeof(struct tng_bond)); + tng_data->molecules[i].bonds = malloc(molecule->n_bonds * + sizeof(struct tng_bond)); if(!molecule->bonds) { printf("Cannot allocate memory (%"PRId64" bytes). %s: %d\n", -- cgit v0.10.1