[asterisk-commits] branch russell/ast_malloc - r7631 /team/russell/ast_malloc/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Dec 25 20:12:40 CST 2005


Author: russell
Date: Sun Dec 25 20:12:39 2005
New Revision: 7631

URL: http://svn.digium.com/view/asterisk?rev=7631&view=rev
Log: (empty)

Modified:
    team/russell/ast_malloc/callerid.c
    team/russell/ast_malloc/cli.c
    team/russell/ast_malloc/db.c

Modified: team/russell/ast_malloc/callerid.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/callerid.c?rev=7631&r1=7630&r2=7631&view=diff
==============================================================================
--- team/russell/ast_malloc/callerid.c (original)
+++ team/russell/ast_malloc/callerid.c Sun Dec 25 20:12:39 2005
@@ -260,7 +260,7 @@
 	short *buf;
 	short *obuf;
 
-	buf = ast_malloc(2 * len + cid->oldlen);	
+	buf = ast_calloc(1, 2 * len + cid->oldlen);	
 	if (!buf)
 		return -1;
 	obuf = buf;

Modified: team/russell/ast_malloc/cli.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/cli.c?rev=7631&r1=7630&r2=7631&view=diff
==============================================================================
--- team/russell/ast_malloc/cli.c (original)
+++ team/russell/ast_malloc/cli.c Sun Dec 25 20:12:39 2005
@@ -568,10 +568,9 @@
 	if (argc != 4)
 		return RESULT_SHOWUSAGE;
 
-	buf = ast_malloc(buflen);
+	buf = ast_calloc(1, buflen);
 	if (!buf)
 		return RESULT_FAILURE;
-	buf[len] = '\0';
 	
 	matches = ast_cli_completion_matches(argv[2], argv[3]);
 	if (matches) {
@@ -1323,7 +1322,7 @@
 		max_equal = i;
 	}
 
-	retstr = ast_malloc(max_equal + 1);
+	retstr = ast_calloc(1, max_equal + 1);
 	if (!retstr)
 		return NULL;		
 

Modified: team/russell/ast_malloc/db.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/db.c?rev=7631&r1=7630&r2=7631&view=diff
==============================================================================
--- team/russell/ast_malloc/db.c (original)
+++ team/russell/ast_malloc/db.c Sun Dec 25 20:12:39 2005
@@ -438,7 +438,7 @@
 			values = "<bad value>";
 		}
 		if (keymatch(keys, prefix)) {
-			cur = ast_malloc(sizeof(struct ast_db_entry) + strlen(keys) + strlen(values) + 2);
+			cur = ast_calloc(1, sizeof(struct ast_db_entry) + strlen(keys) + strlen(values) + 2);
 			if (cur) {
 				cur->next = NULL;
 				cur->key = cur->data + strlen(values) + 1;



More information about the asterisk-commits mailing list