Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Fix memory leak on constant creation
Browse files Browse the repository at this point in the history
ref #24
  • Loading branch information
jklmnn committed Nov 22, 2021
1 parent db86ae8 commit 89c0e85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion z3.adb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ is
Sort : z3_api_h.Z3_sort;
Context : z3_api_h.Z3_context) return z3_api_h.Z3_ast
is
C_Name : constant chars_ptr := New_String (Name);
C_Name : chars_ptr := New_String (Name);
Symbol : constant z3_api_h.Z3_symbol :=
z3_api_h.Z3_mk_string_symbol (c => Context,
s => z3_api_h.Z3_string (C_Name));
begin
Free (C_Name);
return z3_api_h.Z3_mk_const (c => Context,
s => Symbol,
ty => Sort);
Expand Down

0 comments on commit 89c0e85

Please sign in to comment.