Skip to content

Commit

Permalink
Fix memory leak when initializing GAP by finalising parse_cur_data af…
Browse files Browse the repository at this point in the history
…ter xml parsing (also vdW)
  • Loading branch information
bernstei committed Jul 18, 2023
1 parent 72aaf3f commit c2b571c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Potentials/IPModel_GAP.f95
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,8 @@ subroutine IPModel_GAP_read_params_xml(this, param_str)
characters_handler = IPModel_characters_handler)
call close_xml_t(fxml)

call finalise(parse_cur_data)

if(.not. parse_in_ip_done) &
call system_abort('IPModel_GAP_read_params_xml: could not initialise GAP potential. No GAP_params present?')
this%initialised = .true.
Expand Down
2 changes: 2 additions & 0 deletions src/Potentials/IPModel_vdW.f95
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ subroutine IPModel_vdW_read_params_xml(this, param_str)
characters_handler = IPModel_characters_handler)
call close_xml_t(fxml)

call finalise(parse_cur_data)

if(.not. parse_in_ip_done) &
call system_abort('IPModel_vdW_read_params_xml: could not initialise vdW potential. No vdW_params present?')
this%initialised = .true.
Expand Down

0 comments on commit c2b571c

Please sign in to comment.