Skip to content

Commit

Permalink
fix: memory leak fix in iso - sap language conversion methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Feb 2, 2023
1 parent 6fbb35c commit 549e04f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 37 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Asynchronous, non-blocking [SAP NetWeawer RFC SDK](https://support.sap.com/en/pr

- In addition, pre-built wheels are provided for Windows, Darwin and Ubuntu Linux, attached to PyRFC GitHub [release](https://github.com/SAP/PyRFC/releases/latest)

- Docker containers: [SAP fundamental-tools/docker](https://github.com/SAP/fundamental-tools/tree/main/docker)

- Linux wheels supported by build from source installation only

- Pre-built [portable Linux wheels](https://www.python.org/dev/peps/pep-0513/)
Expand Down
88 changes: 53 additions & 35 deletions src/pyrfc/_pyrfc.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/pyrfc/_pyrfc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def language_iso_to_sap(lang_iso):
cdef SAP_UC uclang_sap[8]
cdef RFC_ERROR_INFO errorInfo
cdef RFC_RC rc = RfcLanguageIsoToSap(uclang_iso, uclang_sap, &errorInfo)
free(uclang_iso)
if rc != RFC_OK:
raise wrapError(&errorInfo)
return wrapString(uclang_sap,1)
Expand All @@ -143,12 +144,11 @@ def language_sap_to_iso(lang_sap):
cdef SAP_UC uclang_iso[16]
cdef RFC_ERROR_INFO errorInfo
cdef RFC_RC rc = RfcLanguageSapToIso(uclang_sap, uclang_iso, &errorInfo)
free(uclang_sap)
if rc != RFC_OK:
raise wrapError(&errorInfo)
return wrapString(uclang_iso,2)



def set_cryptolib_path(path_name):
"""Sets the absolute path to the sapcrypto library to enable TLS encryption via Websocket Rfc.
Expand Down

0 comments on commit 549e04f

Please sign in to comment.