# HG changeset patch # User Sebastien Jodogne # Date 1734370509 -3600 # Node ID c4c0640577fb14cd8c3a337e89e524d440d9b526 # Parent 8a500c0defbfce190fe55e388ae67cbd8b554026 fix leaking of strings related to the build environment diff -r 8a500c0defbf -r c4c0640577fb OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Mon Dec 16 17:53:44 2024 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Mon Dec 16 18:35:09 2024 +0100 @@ -44,6 +44,16 @@ #endif +#if ORTHANC_ENABLE_PLUGINS == 1 +# if defined(__ORTHANC_FILE__) +// Prevents the system-wide DCMTK library from leaking the +// full path of this source file in "DCMTLS_ERROR()" +# undef __FILE__ +# define __FILE__ __ORTHANC_FILE__ +# endif +#endif + + namespace Orthanc { namespace Internals diff -r 8a500c0defbf -r c4c0640577fb OrthancServer/Resources/PreventProtobufDirectoryLeaks.py --- a/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py Mon Dec 16 17:53:44 2024 +0100 +++ b/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py Mon Dec 16 18:35:09 2024 +0100 @@ -29,13 +29,21 @@ with open(sys.argv[1], 'r') as f: s = f.read() -s = s.replace('__FILE__', '__ORTHANC_FILE__') +if False: + # This was the version in Orthanc 1.12.4, doesn't seem to work anymore + s = s.replace('__FILE__', '__ORTHANC_FILE__') -s = """ + s = """ #if !defined(__ORTHANC_FILE__) # define __ORTHANC_FILE__ __FILE__ #endif """ + s +else: + # New version in Orthanc 1.12.5 + s = """ +#undef __FILE__ +#define __FILE__ __ORTHANC_FILE__ +""" + s with open(sys.argv[1], 'w') as f: f.write(s)