]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blame - pam_ldap/patches/pam_ldap-183-releaseconfig.patch
Move all packages to root.
[people/pmueller/ipfire-3.x.git] / pam_ldap / patches / pam_ldap-183-releaseconfig.patch
CommitLineData
09a030e4
SS
1Fix a memory leak at cleanup-time.
2
3diff -up pam_ldap/pam_ldap.c pam_ldap/pam_ldap.c
4--- pam_ldap/pam_ldap.c 2009-07-22 15:55:42.000000000 -0400
5+++ pam_ldap/pam_ldap.c 2009-07-22 16:00:23.000000000 -0400
6@@ -437,6 +437,7 @@ static void
7 _release_config (pam_ldap_config_t ** pconfig)
8 {
9 pam_ldap_config_t *c;
10+ pam_ssd_t *ssd, *next_ssd;
11
12 c = *pconfig;
13 if (c == NULL)
14@@ -445,6 +446,9 @@ _release_config (pam_ldap_config_t ** pc
15 if (c->configFile != NULL)
16 free (c->configFile);
17
18+ if (c->uri != NULL)
19+ free (c->uri);
20+
21 if (c->host != NULL)
22 free (c->host);
23
24@@ -474,6 +478,16 @@ _release_config (pam_ldap_config_t ** pc
25 free (c->sslpath);
26 }
27
28+ ssd = c->ssd;
29+ while ( ssd != NULL )
30+ {
31+ next_ssd = ssd->next;
32+ free (ssd->base);
33+ free (ssd->filter);
34+ free (ssd);
35+ ssd = next_ssd;
36+ }
37+
38 if (c->userattr != NULL)
39 {
40 free (c->userattr);
41@@ -509,6 +523,36 @@ _release_config (pam_ldap_config_t ** pc
42 free (c->logdir);
43 }
44
45+ if (c->tls_cacertfile != NULL)
46+ {
47+ free (c->tls_cacertfile);
48+ }
49+
50+ if (c->tls_cacertdir != NULL)
51+ {
52+ free (c->tls_cacertdir);
53+ }
54+
55+ if (c->tls_ciphers != NULL)
56+ {
57+ free (c->tls_ciphers);
58+ }
59+
60+ if (c->tls_cert != NULL)
61+ {
62+ free (c->tls_cert);
63+ }
64+
65+ if (c->tls_key != NULL)
66+ {
67+ free (c->tls_key);
68+ }
69+
70+ if (c->tls_randfile != NULL)
71+ {
72+ free (c->tls_randfile);
73+ }
74+
75 if (c->sasl_mechanism != NULL)
76 {
77 free (c->sasl_mechanism);