From: Jeffrey Altman Date: Mon, 15 Sep 2003 22:02:25 +0000 (+0000) Subject: winnt-avoid-leak-and-memory-corruption-in-afscreds-20030915 X-Git-Tag: openafs-devel-1_3_50~58 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=18d060c68d32807b1c694e58ae524d817d46266c;p=packages%2Fo%2Fopenafs.git winnt-avoid-leak-and-memory-corruption-in-afscreds-20030915 FIXES 2120 WINNT/talocale/TaLocale.h conditionally defines REALLOC() to TaLocaleReallocFunction(). WINNT/client_creds/afscred.h conditionally defines REALLOC() to AfsCredsReallocFunction(). Unfortunately, AfsCredsReallocFunction is never used because REALLOC is always defined first by an include of Talocale.h within afscreds.h. This is a problem because it results in memory being allocated within a DLL and then freed by the EXE. This results in both a memory leak in the DLL and memory corruption in the EXE. --- diff --git a/src/WINNT/client_creds/afscreds.h b/src/WINNT/client_creds/afscreds.h index 14e51a8c7..422c8385c 100644 --- a/src/WINNT/client_creds/afscreds.h +++ b/src/WINNT/client_creds/afscreds.h @@ -17,6 +17,7 @@ */ #include +#undef REALLOC /* RT ticket 2120; So we can redefine it later */ #include #include #include