Skip to content

Commit

Permalink
Merge pull request #407 from yushihang/verify_poseidon_add_cstringfree
Browse files Browse the repository at this point in the history
add cstringFree(resultPtr) to verifyPoseidon()
  • Loading branch information
5eeman authored Jul 4, 2024
2 parents df4f719 + 7e3d76a commit ee9d66d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/identity/libs/bjj/bjj.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ class BabyjubjubLib {
final msgPtr = msg.toNativeUtf8();
final resultPtr = _verifyPoseidon(privateKeyPtr, sigPtr, msgPtr);
final String resultString = resultPtr.toDartString();
//print("- Response string: $resultString");
// Free the string pointer, as we already have
// an owned String to return
//print("- Freeing the native char*");
cstringFree(resultPtr);
final bool result = resultString.compareTo("1") == 0;
return result;
}
Expand Down

0 comments on commit ee9d66d

Please sign in to comment.