RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 09-Nov-2007 18:16:24 Branch: HEAD Handle: 2007110917162400 Modified files: rpm CHANGES rpm/lib poptALL.c Log: - squeaky clean SSL memory cleanup. Ick. Summary: Revision Changes Path 1.1779 +1 -0 rpm/CHANGES 2.49 +30 -2 rpm/lib/poptALL.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.1778 -r1.1779 CHANGES --- rpm/CHANGES 8 Nov 2007 20:33:18 -0000 1.1778 +++ rpm/CHANGES 9 Nov 2007 17:16:24 -0000 1.1779 @@ -1,4 +1,5 @@ 4.5 -> 5.0: + - jbj: squeaky clean SSL memory cleanup. Ick. - rpm.org: start hiding rpmsq internals. - jbj: fix: "trade a double free for a modest memory leak for the moment." - jbj: add headerModifyExtension everywhere. @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c ============================================================================ $ cvs diff -u -r2.48 -r2.49 poptALL.c --- rpm/lib/poptALL.c 4 Nov 2007 00:23:08 -0000 2.48 +++ rpm/lib/poptALL.c 9 Nov 2007 17:16:24 -0000 2.49 @@ -13,13 +13,27 @@ #include <fts.h> #include <mire.h> +#if defined(WITH_NEON) /* XXX this should be done in a rpmioClean() wrapper. */ +#include <ne_utils.h> +#if !defined(HEADER_ERR_H) +/* cheats to avoid having to explicitly build against OpenSSL */ +extern void ERR_remove_state(int foo); +extern void ENGINE_cleanup(void); +extern void CONF_modules_unload(int foo); +extern void ERR_free_strings(void); +extern void EVP_cleanup(void); +extern void CRYPTO_cleanup_all_ex_data(void); +extern void CRYPTO_mem_leaks(void * ptr); +#endif +#endif + #include "debug.h" #define POPT_SHOWVERSION -999 #define POPT_SHOWRC -998 #define POPT_QUERYTAGS -997 #define POPT_PREDEFINE -996 -#ifdef NOTYET +#ifdef DEAD /* XXX remember the previous definition however. */ #define POPT_RCFILE -995 #endif @@ -507,13 +521,27 @@ poptContext rpmcliFini(poptContext optCon) { + /* XXX this should be done in a rpmioClean() wrapper. */ /* keeps memory leak checkers quiet */ rpmFreeMacros(NULL); /[EMAIL PROTECTED]@*/ rpmFreeMacros(rpmCLIMacroContext); rpmFreeRpmrc(); -#ifdef WITH_LUA +#if defined(WITH_LUA) /* XXX this should be done in a rpmioClean() wrapper. */ (void) rpmluaFree(NULL); #endif +#if defined(WITH_NEON) /* XXX this should be done in a rpmioClean() wrapper. */ + if (ne_has_support(NE_FEATURE_SSL)) { +/* XXX http://www.nabble.com/Memory-Leaks-in-SSL_Library_init()-t3431875.html */ + ENGINE_cleanup(); + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + ERR_remove_state(0); + EVP_cleanup(); + CRYPTO_mem_leaks(NULL); + CONF_modules_unload(1); + } +#endif + rpmFreeFilesystems(); /[EMAIL PROTECTED]@*/ urlFreeCache(); rpmlogClose(); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org