Skip to content

Commit

Permalink
Merge pull request #869 from matthiasblaesing/com_memory_leak_string_…
Browse files Browse the repository at this point in the history
…property

Fix memory leak in COMLateBindingObject#getStringProperty
  • Loading branch information
matthiasblaesing authored Oct 30, 2017
2 parents 7566589 + a67d700 commit fa6cb7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Bug Fixes
* [#652](https://github.com/java-native-access/jna/issues/652): Dead Lock in class initialization - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#843](https://github.com/java-native-access/jna/pull/843): Correctly bind `com.sun.jna.platform.win32.SecBufferDesc` and add convenience binding as `com.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDesc`. Bind SSPI functions `InitializeSecurityContext`, `AcceptSecurityContext`, `QueryCredentialsAttributes`, `QuerySecurityPackageInfo`, `EncryptMessage`, `DecryptMessage`, `MakeSignature`, `VerifySignature` in `com.sun.jna.platform.win32.Secur32` - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#863](https://github.com/java-native-access/jna/pull/863): Fix ARM softfloat/hardfloat detection by modifying armSoftFloat condition in ELFAnalyser. Before this fix a softfloat binary could be misdetected as hardfloat. - [@kunkun26](https://github.com/kunkun26).
* [#867](https://github.com/java-native-access/jna/issues/867): Fix memory leak in `COMLateBindingObject#getStringProperty` - [@matthiasblaesing](https://github.com/matthiasblaesing).

Breaking Changes
----------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ protected String getStringProperty(String propertyName) {
this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result,
this.getIDispatch(), propertyName);

return result.stringValue();
String res = result.stringValue();

OleAuto.INSTANCE.VariantClear(result);

return res;
}

/**
Expand Down

0 comments on commit fa6cb7e

Please sign in to comment.