Skip to content

orc-codemem: Don't free() filename before its last usage in debug output

../subprojects/orc/orc/orccodemem.c: In function ‘orc_code_region_allocate_codemem_dual_map.constprop’:
../subprojects/orc/orc/orcdebug.h:138:3: warning: pointer ‘filename’ may be used after ‘free’ [-Wuse-after-free]
  138 |   orc_debug_print((level), __FILE__, ORC_FUNCTION, __LINE__, __VA_ARGS__); \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/orc/orc/orcdebug.h:92:26: note: in expansion of macro ‘ORC_DEBUG_PRINT’
   92 | #define ORC_WARNING(...) ORC_DEBUG_PRINT(ORC_DEBUG_WARNING, __VA_ARGS__)
      |                          ^~~~~~~~~~~~~~~
../subprojects/orc/orc/orccodemem.c:252:5: note: in expansion of macro ‘ORC_WARNING’
  252 |     ORC_WARNING ("failed to create write map '%s'. err=%i", filename, errno);
      |     ^~~~~~~~~~~
../subprojects/orc/orc/orccodemem.c:234:3: note: call to ‘free’ here
  234 |   free (filename);
      |   ^~~~~~~~~~~~~~~
Edited by Sebastian Dröge

Merge request reports

Loading