[asterisk-commits] russell: branch group/res_config_ldap r63966 - /team/group/res_config_ldap/res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 11 12:52:15 MST 2007


Author: russell
Date: Fri May 11 14:52:15 2007
New Revision: 63966

URL: http://svn.digium.com/view/asterisk?view=rev&rev=63966
Log:
fix memory leak

Modified:
    team/group/res_config_ldap/res/res_config_ldap.c

Modified: team/group/res_config_ldap/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/res/res_config_ldap.c?view=diff&rev=63966&r1=63965&r2=63966
==============================================================================
--- team/group/res_config_ldap/res/res_config_ldap.c (original)
+++ team/group/res_config_ldap/res/res_config_ldap.c Fri May 11 14:52:15 2007
@@ -806,8 +806,7 @@
 	int foundEscape = 0;
 	struct ast_variable *nextEscape = table_config->escapes;
 	char *esc_value = NULL;
-	char *esc_tmp;
-	esc_tmp = (char *) ast_calloc(1,2);
+	char esc_tmp[2];
 	
 	
 	for(nextEscape = table_config->escapes; nextEscape ; nextEscape = nextEscape->next ){
@@ -817,11 +816,11 @@
 		}
 	}
 	
-	if(foundEscape == 1){
+	if (foundEscape == 1){
 		esc_value = strdup(value);
-		strcpy(esc_tmp,"\\");
-		strcat(esc_tmp,nextEscape->value);
-		replace_string_in_string(esc_value, nextEscape->value,esc_tmp); 
+		strcpy(esc_tmp, "\\");
+		strcat(esc_tmp, nextEscape->value);
+		replace_string_in_string(esc_value, nextEscape->value, esc_tmp); 
 		value = esc_value;
 	}
 	/* The remaining filter mods */



More information about the asterisk-commits mailing list