diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/tng_io.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 7e78a85..4c375dd 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -3996,11 +3996,10 @@ static tng_function_status tng_compress(tng_trajectory_t tng_data, block->block_contents_size, __FILE__, __LINE__); return(TNG_CRITICAL); } - + block->block_contents = temp; if(dest) { memcpy(temp + offset, dest, new_len); - free(dest); } else @@ -4009,8 +4008,6 @@ static tng_function_status tng_compress(tng_trajectory_t tng_data, return(TNG_FAILURE); } - block->block_contents = temp; - return(TNG_SUCCESS); } @@ -4158,12 +4155,12 @@ static tng_function_status tng_gzip_compress(tng_trajectory_t tng_data, return(TNG_CRITICAL); } + block->block_contents = temp; + memcpy(temp + offset, dest, max_len); free(dest); - block->block_contents = temp; - return(TNG_SUCCESS); } |