From: Bernhard Übelacker bernhardu@mailbox.org
The pointer in tmplocale gets freed in the second setlocale call. Therefore ASan triggers when trying to restore the locale the the already freed pointer in tmplocale in the third call to setlocale. --- dlls/wineps.drv/psdrv.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h index 2c4703de942..69cb1cfc0f0 100644 --- a/dlls/wineps.drv/psdrv.h +++ b/dlls/wineps.drv/psdrv.h @@ -546,10 +546,12 @@ extern void passthrough_leave(print_ctx *ctx);
#define push_lc_numeric(x) do { \ const char *tmplocale = setlocale(LC_NUMERIC,NULL); \ + tmplocale = tmplocale ? strdup(tmplocale) : NULL; \ setlocale(LC_NUMERIC,x);
#define pop_lc_numeric() \ setlocale(LC_NUMERIC,tmplocale); \ + free(tmplocale); \ } while (0)
static inline WCHAR *strdupW( const WCHAR *str )