mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Merged revisions 304865 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r304865 | seanbright | 2011-01-29 18:05:25 -0500 (Sat, 29 Jan 2011) | 7 lines Plug some memory leaks in the LDAP realtime driver. (closes issue #18435) Reported by: zaltar Patches: res_config_ldap.patch uploaded by zaltar (license 1148) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@304866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -343,6 +343,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config | ||||
| 			} | ||||
| 			ldap_value_free_len(values); | ||||
| 		} | ||||
| 		ldap_memfree(ldap_attribute_name); | ||||
| 		ldap_attribute_name = ldap_next_attribute(ldapConn, ldap_entry, ber); | ||||
| 	} | ||||
| 	ber_free(ber, 0); | ||||
| @@ -508,6 +509,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf | ||||
| 					} /*!< for (v = values; *v; v++) */ | ||||
| 					ldap_value_free_len(values); | ||||
| 				}/*!< if (values) */ | ||||
| 				ldap_memfree(ldap_attribute_name); | ||||
| 				ldap_attribute_name = ldap_next_attribute(ldapConn, ldap_entry, ber); | ||||
| 			} /*!< while (ldap_attribute_name) */ | ||||
| 			ber_free(ber, 0); | ||||
| @@ -1324,7 +1326,7 @@ static int update_ldap(const char *basedn, const char *table_name, const char *a | ||||
| 				ast_log(LOG_ERROR, "Couldn't modify '%s'='%s', dn:%s because %s\n", | ||||
| 						attribute, lookup, dn, ldap_err2string(error)); | ||||
| 			} | ||||
|  | ||||
| 			ldap_memfree(dn); | ||||
| 			ldap_entry = ldap_next_entry(ldapConn, ldap_entry); | ||||
| 		} | ||||
| 	} | ||||
| @@ -1506,7 +1508,7 @@ static int update2_ldap(const char *basedn, const char *table_name, va_list ap) | ||||
| 			if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS)  { | ||||
| 				ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn, ldap_err2string(error)); | ||||
| 			} | ||||
|  | ||||
| 			ldap_memfree(dn); | ||||
| 			ldap_entry = ldap_next_entry(ldapConn, ldap_entry); | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user