|
From: <nor...@us...> - 2007-05-09 22:48:17
|
Revision: 17
http://opencalea.svn.sourceforge.net/opencalea/?rev=17&view=rev
Author: norm_brandinger
Date: 2007-05-09 15:48:18 -0700 (Wed, 09 May 2007)
Log Message:
-----------
Replaced malloc with local Calloc in df_collector
Modified Paths:
--------------
src/df_collector.c
Modified: src/df_collector.c
===================================================================
--- src/df_collector.c 2007-05-09 21:08:02 UTC (rev 16)
+++ src/df_collector.c 2007-05-09 22:48:18 UTC (rev 17)
@@ -187,10 +187,7 @@
/* Get CmII_Path from config file */
if ((confptr = get_config(&config, "CmII_Path")) != NULL) {
- cmii_path = malloc(strlen(*confptr->nextval) + 1);
- if (!cmii_path) {
- debug_5("df_collector: memory allocation for cmii_path failed");
- }
+ cmii_path = Calloc(strlen(*confptr->nextval) + 1);
bzero(cmii_path,strlen(*confptr->nextval) + 1);
strncpy(cmii_path, *confptr->nextval, strlen(*confptr->nextval));
debug_5("df_collector: CmII_Path [%s]", cmii_path);
@@ -198,10 +195,7 @@
/* Get CmC_Path from config file */
if ((confptr = get_config(&config, "CmC_Path")) != NULL) {
- cmc_path = malloc(strlen(*confptr->nextval) + 1);
- if (!cmc_path) {
- debug_5("df_collector: memory allocation for cmc_path failed");
- }
+ cmc_path = Calloc(strlen(*confptr->nextval) + 1);
bzero(cmc_path,strlen(*confptr->nextval) + 1);
strncpy(cmc_path, *confptr->nextval, strlen(*confptr->nextval));
debug_5("df_collector: CmC_Path [%s]", cmc_path);
@@ -209,10 +203,7 @@
/* Get Log_Path from config file */
if ((confptr = get_config(&config, "Log_Path")) != NULL) {
- log_path = malloc(strlen(*confptr->nextval) + 1);
- if (!log_path) {
- debug_5("df_collector: memory allocation for capture_path failed");
- }
+ log_path = Calloc(strlen(*confptr->nextval) + 1);
bzero(log_path, strlen(*confptr->nextval) + 1);
strncpy(log_path, *confptr->nextval, strlen(*confptr->nextval));
debug_5("df_collector: log_path [%s]", log_path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|