mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
DeePMD: Fix memory leak in deepmd_model_load
This commit is contained in:
parent
2eb13e25da
commit
4c33f953fe
1 changed files with 7 additions and 0 deletions
|
|
@ -68,6 +68,12 @@ CONTAINS
|
|||
TYPE(C_PTR) :: DeepPotCheckOK
|
||||
END FUNCTION DeepPotCheckOK
|
||||
END INTERFACE
|
||||
INTERFACE
|
||||
SUBROUTINE DeleteChar(ptr) BIND(C, name="DP_DeleteChar")
|
||||
IMPORT :: C_PTR
|
||||
TYPE(C_PTR), VALUE :: ptr
|
||||
END SUBROUTINE DeleteChar
|
||||
END INTERFACE
|
||||
|
||||
CALL timeset(routineN, handle)
|
||||
|
||||
|
|
@ -85,6 +91,7 @@ CONTAINS
|
|||
IF (error_f_ptr(i) == C_NULL_CHAR) EXIT
|
||||
error_str(i:i) = error_f_ptr(i)
|
||||
END DO
|
||||
CALL DeleteChar(error_c_ptr)
|
||||
IF (LEN_TRIM(error_str) > 0) CPABORT(TRIM(error_str))
|
||||
#else
|
||||
CPABORT("CP2K was compiled without libdeepmd_c library.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue