Juan Lang : cryptnet: Fix memory leaks querying an object.

Alexandre Julliard julliard at winehq.org
Fri Nov 20 10:47:59 CST 2009


Module: wine
Branch: master
Commit: 35dbc201ae3e2540127c0efd01ac64931cbcac18
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=35dbc201ae3e2540127c0efd01ac64931cbcac18

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Nov 19 10:11:12 2009 -0800

cryptnet: Fix memory leaks querying an object.

---

 dlls/cryptnet/cryptnet_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c
index 9301a56..8a803eb 100644
--- a/dlls/cryptnet/cryptnet_main.c
+++ b/dlls/cryptnet/cryptnet_main.c
@@ -1246,20 +1246,24 @@ static BOOL WINAPI CRYPT_CreateAny(LPCSTR pszObjectOid,
                         if (!CertAddCertificateContextToStore(store,
                          context, CERT_STORE_ADD_ALWAYS, NULL))
                             ret = FALSE;
+                        CertFreeCertificateContext(context);
                         break;
                     case CERT_QUERY_CONTENT_CRL:
                         if (!CertAddCRLContextToStore(store,
                          context, CERT_STORE_ADD_ALWAYS, NULL))
                              ret = FALSE;
+                        CertFreeCRLContext(context);
                         break;
                     case CERT_QUERY_CONTENT_CTL:
                         if (!CertAddCTLContextToStore(store,
                          context, CERT_STORE_ADD_ALWAYS, NULL))
                              ret = FALSE;
+                        CertFreeCTLContext(context);
                         break;
                     default:
                         CertAddStoreToCollection(store, contextStore, 0, 0);
                     }
+                    CertCloseStore(contextStore, 0);
                 }
                 else
                     ret = FALSE;




More information about the wine-cvs mailing list