[asterisk-commits] branch kpfleming/stringfields - r7755 /team/kpfleming/stringfields/include/as...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 3 17:52:19 CST 2006


Author: kpfleming
Date: Tue Jan  3 17:52:19 2006
New Revision: 7755

URL: http://svn.digium.com/view/asterisk?rev=7755&view=rev
Log:
don't free fields that were never used

Modified:
    team/kpfleming/stringfields/include/asterisk/stringfields.h

Modified: team/kpfleming/stringfields/include/asterisk/stringfields.h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/stringfields/include/asterisk/stringfields.h?rev=7755&r1=7754&r2=7755&view=diff
==============================================================================
--- team/kpfleming/stringfields/include/asterisk/stringfields.h (original)
+++ team/kpfleming/stringfields/include/asterisk/stringfields.h Tue Jan  3 17:52:19 2006
@@ -50,12 +50,14 @@
 	asprintf((char **) &x->field, fmt, args)
 
 #define ast_string_field_free(x, field) \
-	free((char *) x->field)
+	if (x->field) \
+		free((char *) x->field)
 
 #define ast_string_field_free_all(x) { \
 	int index; \
 	for (index = 0; index < ast_string_field_count(x); index ++) \
-		free(x->__begin_field[index]); \
+		if (x->__begin_field[index]) \
+			free(x->__begin_field[index]); \
 	}
 
 #endif /* _ASTERISK_STRINGFIELDS_H */



More information about the asterisk-commits mailing list