Loading include/nmxp.h +2 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp.h,v 1.49 2008-03-20 12:42:08 mtheo Exp $ * $Id: nmxp.h,v 1.50 2008-03-28 13:21:24 mtheo Exp $ * */ Loading Loading @@ -988,6 +988,7 @@ Mail bug reports and suggestions to <quintiliani@ingv.it>. #include "nmxp_base.h" #include "nmxp_crc32.h" #include "nmxp_memory.h" #define NMXP_MAX_MSCHAN_MSEC 15000 Loading lib/nmxp.c +23 −22 Original line number Diff line number Diff line Loading @@ -7,11 +7,12 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp.c,v 1.80 2008-03-28 07:32:31 mtheo Exp $ * $Id: nmxp.c,v 1.81 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp.h" #include "nmxp_memory.h" #include "config.h" Loading Loading @@ -79,7 +80,7 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) { int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag) { int ret; int32_t buffer_length = 16 + (4 * channelList->number); char *buffer = malloc(buffer_length); char *buffer = NMXP_MEM_MALLOC(buffer_length); int32_t app, i, disp; disp=0; Loading Loading @@ -109,7 +110,7 @@ int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList ret = nmxp_sendMessage(isock, NMXP_MSG_ADDTIMESERIESCHANNELS, buffer, buffer_length); if(buffer) { free(buffer); NMXP_MEM_FREE(buffer); buffer = NULL; } return ret; Loading Loading @@ -372,7 +373,7 @@ int nmxp_waitReady(int isock) { if(length > 0) { if(type == NMXP_MSG_TERMINATESUBSCRIPTION) { char *str_msg = NULL; char *buf_app = (char *) malloc(sizeof(char) * length); char *buf_app = (char *) NMXP_MEM_MALLOC(sizeof(char) * length); int32_t reason; memcpy(&reason, buf_app, sizeof(reason)); reason = ntohl(reason); Loading @@ -383,7 +384,7 @@ int nmxp_waitReady(int isock) { (reason == 0)? "Normal" : (reason == 1)? "Error" : (reason == 2)? "Timeout" : "Unknown", str_msg); if(buf_app) { free(buf_app); NMXP_MEM_FREE(buf_app); buf_app = NULL; } /* Close the socket*/ Loading @@ -396,10 +397,10 @@ int nmxp_waitReady(int isock) { app = ntohl(app); nmxp_log(NMXP_LOG_NORM, NMXP_LOG_D_CONNFLOW, "value = %d\n", app); } else { char *buf_app = (char *) malloc(sizeof(char) * length); char *buf_app = (char *) NMXP_MEM_MALLOC(sizeof(char) * length); rc = nmxp_recv_ctrl(isock, buf_app, length, 0, &recv_errno); if(buf_app) { free(buf_app); NMXP_MEM_FREE(buf_app); buf_app = NULL; } } Loading Loading @@ -495,7 +496,7 @@ NMXP_CHAN_LIST *nmxp_getAvailableChannelList(char * hostname, int portnum, NMXP_ } if(channelList) { free(channelList); NMXP_MEM_FREE(channelList); channelList = NULL; } Loading Loading @@ -696,7 +697,7 @@ void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_t raw_stream_buffer->max_pdlist_items = max_tolerable_latency * 4; raw_stream_buffer->timeoutrecv = timeoutrecv; raw_stream_buffer->n_pdlist = 0; raw_stream_buffer->pdlist = (NMXP_DATA_PROCESS **) malloc (raw_stream_buffer->max_pdlist_items * sizeof(NMXP_DATA_PROCESS *)); raw_stream_buffer->pdlist = (NMXP_DATA_PROCESS **) NMXP_MEM_MALLOC(raw_stream_buffer->max_pdlist_items * sizeof(NMXP_DATA_PROCESS *)); for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) { raw_stream_buffer->pdlist[j] = NULL; } Loading @@ -711,18 +712,18 @@ void nmxp_raw_stream_free(NMXP_RAW_STREAM_DATA *raw_stream_buffer) { for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) { if(raw_stream_buffer->pdlist[j]) { if(raw_stream_buffer->pdlist[j]->buffer) { free(raw_stream_buffer->pdlist[j]->buffer); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]->buffer); raw_stream_buffer->pdlist[j]->buffer = NULL; } if(raw_stream_buffer->pdlist[j]->pDataPtr) { free(raw_stream_buffer->pdlist[j]->pDataPtr); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]->pDataPtr); raw_stream_buffer->pdlist[j]->pDataPtr = NULL; } free(raw_stream_buffer->pdlist[j]); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]); raw_stream_buffer->pdlist[j] = NULL; } } free(raw_stream_buffer->pdlist); NMXP_MEM_FREE(raw_stream_buffer->pdlist); raw_stream_buffer->pdlist = NULL; } } Loading Loading @@ -752,16 +753,16 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int */ /* Allocate memory for pd and copy a_pd */ pd = (NMXP_DATA_PROCESS *) malloc (sizeof(NMXP_DATA_PROCESS)); pd = (NMXP_DATA_PROCESS *) NMXP_MEM_MALLOC(sizeof(NMXP_DATA_PROCESS)); memcpy(pd, a_pd, sizeof(NMXP_DATA_PROCESS)); if(a_pd->length > 0) { pd->buffer = malloc(pd->length); pd->buffer = NMXP_MEM_MALLOC(pd->length); memcpy(pd->buffer, a_pd->buffer, a_pd->length); } else { pd->buffer = NULL; } if(a_pd->nSamp * sizeof(int) > 0) { pd->pDataPtr = (int *) malloc(a_pd->nSamp * sizeof(int)); pd->pDataPtr = (int *) NMXP_MEM_MALLOC(a_pd->nSamp * sizeof(int)); memcpy(pd->pDataPtr, a_pd->pDataPtr, a_pd->nSamp * sizeof(int)); } else { pd->pDataPtr = NULL; Loading Loading @@ -830,15 +831,15 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int /* Free handled packet */ if(p->pdlist[0]->buffer) { free(p->pdlist[0]->buffer); NMXP_MEM_FREE(p->pdlist[0]->buffer); p->pdlist[0]->buffer = NULL; } if(p->pdlist[0]->pDataPtr) { free(p->pdlist[0]->pDataPtr); NMXP_MEM_FREE(p->pdlist[0]->pDataPtr); p->pdlist[0]->pDataPtr = NULL; } if(p->pdlist[0]) { free(p->pdlist[0]); NMXP_MEM_FREE(p->pdlist[0]); p->pdlist[0] = NULL; } if(pd) { Loading Loading @@ -976,15 +977,15 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int for(k=0; k < p->n_pdlist; k++) { if(k < j) { if(p->pdlist[k]->buffer) { free(p->pdlist[k]->buffer); NMXP_MEM_FREE(p->pdlist[k]->buffer); p->pdlist[k]->buffer = NULL; } if(p->pdlist[k]->pDataPtr) { free(p->pdlist[k]->pDataPtr); NMXP_MEM_FREE(p->pdlist[k]->pDataPtr); p->pdlist[k]->pDataPtr = NULL; } if(p->pdlist[k]) { free(p->pdlist[k]); NMXP_MEM_FREE(p->pdlist[k]); p->pdlist[k] = NULL; } } Loading lib/nmxp_base.c +3 −2 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_base.c,v 1.66 2008-03-26 15:48:38 mtheo Exp $ * $Id: nmxp_base.c,v 1.67 2008-03-28 13:21:24 mtheo Exp $ * */ #include "config.h" #include "nmxp_base.h" #include "nmxp_memory.h" #ifdef HAVE_WINDOWS_H #include "nmxp_win.h" #endif Loading Loading @@ -402,7 +403,7 @@ int nmxp_receiveMessage(int isock, NMXP_MSG_SERVER *type, void **buffer, int32_t if( ret == NMXP_SOCKET_OK ) { if (*length > 0) { *buffer = malloc(*length); *buffer = NMXP_MEM_MALLOC(*length); ret = nmxp_recv_ctrl(isock, *buffer, *length, 0, recv_errno); if(*type == NMXP_MSG_TERMINATESUBSCRIPTION) { Loading lib/nmxp_chan.c +8 −7 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_chan.c,v 1.39 2008-03-28 07:32:31 mtheo Exp $ * $Id: nmxp_chan.c,v 1.40 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp_chan.h" #include "nmxp_base.h" #include "nmxp_memory.h" #include <string.h> #include <stdlib.h> Loading @@ -30,7 +31,7 @@ int nmxp_chan_cpy_sta_chan(const char *net_dot_station_dot_channel, char *statio channel_code[0] = 0; network_code[0] = 0; tmp_name = strdup(net_dot_station_dot_channel); tmp_name = NMXP_MEM_STRDUP(net_dot_station_dot_channel); /* count '.' */ i=0; while(i < strlen(tmp_name) && !errors) { Loading Loading @@ -66,7 +67,7 @@ int nmxp_chan_cpy_sta_chan(const char *net_dot_station_dot_channel, char *statio } if(tmp_name) { free(tmp_name); NMXP_MEM_FREE(tmp_name); tmp_name = NULL; } Loading Loading @@ -256,7 +257,7 @@ NMXP_CHAN_LIST *nmxp_chan_getType(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE dat int chan_number = channelList->number; int i_chan = 0; ret_channelList = (NMXP_CHAN_LIST *) malloc(sizeof(NMXP_CHAN_LIST)); ret_channelList = (NMXP_CHAN_LIST *) NMXP_MEM_MALLOC(sizeof(NMXP_CHAN_LIST)); ret_channelList->number = 0; for (i_chan = 0; i_chan < chan_number; i_chan++) Loading Loading @@ -285,7 +286,7 @@ NMXP_CHAN_LIST_NET *nmxp_chan_subset(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE char *nmxp_channel_name = NULL; char nmxp_channel_name_duplicated[50]; ret_channelList = (NMXP_CHAN_LIST_NET *) malloc(sizeof(NMXP_CHAN_LIST_NET)); ret_channelList = (NMXP_CHAN_LIST_NET *) NMXP_MEM_MALLOC(sizeof(NMXP_CHAN_LIST_NET)); ret_channelList->number = 0; istalist = 0; Loading Loading @@ -437,7 +438,7 @@ void nmxp_meta_chan_free(NMXP_META_CHAN_LIST **chan_list) { if(iter) { iter_next = iter->next; while(iter) { free(iter); NMXP_MEM_FREE(iter); iter = iter_next; iter_next = iter->next; } Loading Loading @@ -490,7 +491,7 @@ NMXP_META_CHAN_LIST *nmxp_meta_chan_add(NMXP_META_CHAN_LIST **chan_list, int32_t sorttype = NMXP_META_SORT_KEY; } new_item = (NMXP_META_CHAN_LIST *) malloc(sizeof(NMXP_META_CHAN_LIST)); new_item = (NMXP_META_CHAN_LIST *) NMXP_MEM_MALLOC(sizeof(NMXP_META_CHAN_LIST)); new_item->key = 0; new_item->name[0] = 0; new_item->start_time = 0; Loading lib/nmxp_data.c +3 −2 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_data.c,v 1.59 2008-03-24 20:29:28 mtheo Exp $ * $Id: nmxp_data.c,v 1.60 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp_data.h" #include "nmxp_log.h" #include "nmxp_memory.h" #include <stdio.h> #include <stdlib.h> Loading Loading @@ -698,7 +699,7 @@ int nmxp_data_msr_pack(NMXP_DATA_PROCESS *pd, NMXP_DATA_SEED *data_seed, void *p msr->sampletype = 'i'; /* declare type to be 32-bit integers */ msr->numsamples = pd->nSamp; msr->datasamples = malloc (sizeof(int) * (msr->numsamples)); msr->datasamples = NMXP_MEM_MALLOC (sizeof(int) * (msr->numsamples)); memcpy(msr->datasamples, pd->pDataPtr, sizeof(int) * pd->nSamp); /* pointer to 32-bit integer data samples */ msr_srcname (msr, data_seed->srcname, 0); Loading Loading
include/nmxp.h +2 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp.h,v 1.49 2008-03-20 12:42:08 mtheo Exp $ * $Id: nmxp.h,v 1.50 2008-03-28 13:21:24 mtheo Exp $ * */ Loading Loading @@ -988,6 +988,7 @@ Mail bug reports and suggestions to <quintiliani@ingv.it>. #include "nmxp_base.h" #include "nmxp_crc32.h" #include "nmxp_memory.h" #define NMXP_MAX_MSCHAN_MSEC 15000 Loading
lib/nmxp.c +23 −22 Original line number Diff line number Diff line Loading @@ -7,11 +7,12 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp.c,v 1.80 2008-03-28 07:32:31 mtheo Exp $ * $Id: nmxp.c,v 1.81 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp.h" #include "nmxp_memory.h" #include "config.h" Loading Loading @@ -79,7 +80,7 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) { int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag) { int ret; int32_t buffer_length = 16 + (4 * channelList->number); char *buffer = malloc(buffer_length); char *buffer = NMXP_MEM_MALLOC(buffer_length); int32_t app, i, disp; disp=0; Loading Loading @@ -109,7 +110,7 @@ int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList ret = nmxp_sendMessage(isock, NMXP_MSG_ADDTIMESERIESCHANNELS, buffer, buffer_length); if(buffer) { free(buffer); NMXP_MEM_FREE(buffer); buffer = NULL; } return ret; Loading Loading @@ -372,7 +373,7 @@ int nmxp_waitReady(int isock) { if(length > 0) { if(type == NMXP_MSG_TERMINATESUBSCRIPTION) { char *str_msg = NULL; char *buf_app = (char *) malloc(sizeof(char) * length); char *buf_app = (char *) NMXP_MEM_MALLOC(sizeof(char) * length); int32_t reason; memcpy(&reason, buf_app, sizeof(reason)); reason = ntohl(reason); Loading @@ -383,7 +384,7 @@ int nmxp_waitReady(int isock) { (reason == 0)? "Normal" : (reason == 1)? "Error" : (reason == 2)? "Timeout" : "Unknown", str_msg); if(buf_app) { free(buf_app); NMXP_MEM_FREE(buf_app); buf_app = NULL; } /* Close the socket*/ Loading @@ -396,10 +397,10 @@ int nmxp_waitReady(int isock) { app = ntohl(app); nmxp_log(NMXP_LOG_NORM, NMXP_LOG_D_CONNFLOW, "value = %d\n", app); } else { char *buf_app = (char *) malloc(sizeof(char) * length); char *buf_app = (char *) NMXP_MEM_MALLOC(sizeof(char) * length); rc = nmxp_recv_ctrl(isock, buf_app, length, 0, &recv_errno); if(buf_app) { free(buf_app); NMXP_MEM_FREE(buf_app); buf_app = NULL; } } Loading Loading @@ -495,7 +496,7 @@ NMXP_CHAN_LIST *nmxp_getAvailableChannelList(char * hostname, int portnum, NMXP_ } if(channelList) { free(channelList); NMXP_MEM_FREE(channelList); channelList = NULL; } Loading Loading @@ -696,7 +697,7 @@ void nmxp_raw_stream_init(NMXP_RAW_STREAM_DATA *raw_stream_buffer, int32_t max_t raw_stream_buffer->max_pdlist_items = max_tolerable_latency * 4; raw_stream_buffer->timeoutrecv = timeoutrecv; raw_stream_buffer->n_pdlist = 0; raw_stream_buffer->pdlist = (NMXP_DATA_PROCESS **) malloc (raw_stream_buffer->max_pdlist_items * sizeof(NMXP_DATA_PROCESS *)); raw_stream_buffer->pdlist = (NMXP_DATA_PROCESS **) NMXP_MEM_MALLOC(raw_stream_buffer->max_pdlist_items * sizeof(NMXP_DATA_PROCESS *)); for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) { raw_stream_buffer->pdlist[j] = NULL; } Loading @@ -711,18 +712,18 @@ void nmxp_raw_stream_free(NMXP_RAW_STREAM_DATA *raw_stream_buffer) { for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) { if(raw_stream_buffer->pdlist[j]) { if(raw_stream_buffer->pdlist[j]->buffer) { free(raw_stream_buffer->pdlist[j]->buffer); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]->buffer); raw_stream_buffer->pdlist[j]->buffer = NULL; } if(raw_stream_buffer->pdlist[j]->pDataPtr) { free(raw_stream_buffer->pdlist[j]->pDataPtr); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]->pDataPtr); raw_stream_buffer->pdlist[j]->pDataPtr = NULL; } free(raw_stream_buffer->pdlist[j]); NMXP_MEM_FREE(raw_stream_buffer->pdlist[j]); raw_stream_buffer->pdlist[j] = NULL; } } free(raw_stream_buffer->pdlist); NMXP_MEM_FREE(raw_stream_buffer->pdlist); raw_stream_buffer->pdlist = NULL; } } Loading Loading @@ -752,16 +753,16 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int */ /* Allocate memory for pd and copy a_pd */ pd = (NMXP_DATA_PROCESS *) malloc (sizeof(NMXP_DATA_PROCESS)); pd = (NMXP_DATA_PROCESS *) NMXP_MEM_MALLOC(sizeof(NMXP_DATA_PROCESS)); memcpy(pd, a_pd, sizeof(NMXP_DATA_PROCESS)); if(a_pd->length > 0) { pd->buffer = malloc(pd->length); pd->buffer = NMXP_MEM_MALLOC(pd->length); memcpy(pd->buffer, a_pd->buffer, a_pd->length); } else { pd->buffer = NULL; } if(a_pd->nSamp * sizeof(int) > 0) { pd->pDataPtr = (int *) malloc(a_pd->nSamp * sizeof(int)); pd->pDataPtr = (int *) NMXP_MEM_MALLOC(a_pd->nSamp * sizeof(int)); memcpy(pd->pDataPtr, a_pd->pDataPtr, a_pd->nSamp * sizeof(int)); } else { pd->pDataPtr = NULL; Loading Loading @@ -830,15 +831,15 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int /* Free handled packet */ if(p->pdlist[0]->buffer) { free(p->pdlist[0]->buffer); NMXP_MEM_FREE(p->pdlist[0]->buffer); p->pdlist[0]->buffer = NULL; } if(p->pdlist[0]->pDataPtr) { free(p->pdlist[0]->pDataPtr); NMXP_MEM_FREE(p->pdlist[0]->pDataPtr); p->pdlist[0]->pDataPtr = NULL; } if(p->pdlist[0]) { free(p->pdlist[0]); NMXP_MEM_FREE(p->pdlist[0]); p->pdlist[0] = NULL; } if(pd) { Loading Loading @@ -976,15 +977,15 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int for(k=0; k < p->n_pdlist; k++) { if(k < j) { if(p->pdlist[k]->buffer) { free(p->pdlist[k]->buffer); NMXP_MEM_FREE(p->pdlist[k]->buffer); p->pdlist[k]->buffer = NULL; } if(p->pdlist[k]->pDataPtr) { free(p->pdlist[k]->pDataPtr); NMXP_MEM_FREE(p->pdlist[k]->pDataPtr); p->pdlist[k]->pDataPtr = NULL; } if(p->pdlist[k]) { free(p->pdlist[k]); NMXP_MEM_FREE(p->pdlist[k]); p->pdlist[k] = NULL; } } Loading
lib/nmxp_base.c +3 −2 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_base.c,v 1.66 2008-03-26 15:48:38 mtheo Exp $ * $Id: nmxp_base.c,v 1.67 2008-03-28 13:21:24 mtheo Exp $ * */ #include "config.h" #include "nmxp_base.h" #include "nmxp_memory.h" #ifdef HAVE_WINDOWS_H #include "nmxp_win.h" #endif Loading Loading @@ -402,7 +403,7 @@ int nmxp_receiveMessage(int isock, NMXP_MSG_SERVER *type, void **buffer, int32_t if( ret == NMXP_SOCKET_OK ) { if (*length > 0) { *buffer = malloc(*length); *buffer = NMXP_MEM_MALLOC(*length); ret = nmxp_recv_ctrl(isock, *buffer, *length, 0, recv_errno); if(*type == NMXP_MSG_TERMINATESUBSCRIPTION) { Loading
lib/nmxp_chan.c +8 −7 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_chan.c,v 1.39 2008-03-28 07:32:31 mtheo Exp $ * $Id: nmxp_chan.c,v 1.40 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp_chan.h" #include "nmxp_base.h" #include "nmxp_memory.h" #include <string.h> #include <stdlib.h> Loading @@ -30,7 +31,7 @@ int nmxp_chan_cpy_sta_chan(const char *net_dot_station_dot_channel, char *statio channel_code[0] = 0; network_code[0] = 0; tmp_name = strdup(net_dot_station_dot_channel); tmp_name = NMXP_MEM_STRDUP(net_dot_station_dot_channel); /* count '.' */ i=0; while(i < strlen(tmp_name) && !errors) { Loading Loading @@ -66,7 +67,7 @@ int nmxp_chan_cpy_sta_chan(const char *net_dot_station_dot_channel, char *statio } if(tmp_name) { free(tmp_name); NMXP_MEM_FREE(tmp_name); tmp_name = NULL; } Loading Loading @@ -256,7 +257,7 @@ NMXP_CHAN_LIST *nmxp_chan_getType(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE dat int chan_number = channelList->number; int i_chan = 0; ret_channelList = (NMXP_CHAN_LIST *) malloc(sizeof(NMXP_CHAN_LIST)); ret_channelList = (NMXP_CHAN_LIST *) NMXP_MEM_MALLOC(sizeof(NMXP_CHAN_LIST)); ret_channelList->number = 0; for (i_chan = 0; i_chan < chan_number; i_chan++) Loading Loading @@ -285,7 +286,7 @@ NMXP_CHAN_LIST_NET *nmxp_chan_subset(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE char *nmxp_channel_name = NULL; char nmxp_channel_name_duplicated[50]; ret_channelList = (NMXP_CHAN_LIST_NET *) malloc(sizeof(NMXP_CHAN_LIST_NET)); ret_channelList = (NMXP_CHAN_LIST_NET *) NMXP_MEM_MALLOC(sizeof(NMXP_CHAN_LIST_NET)); ret_channelList->number = 0; istalist = 0; Loading Loading @@ -437,7 +438,7 @@ void nmxp_meta_chan_free(NMXP_META_CHAN_LIST **chan_list) { if(iter) { iter_next = iter->next; while(iter) { free(iter); NMXP_MEM_FREE(iter); iter = iter_next; iter_next = iter->next; } Loading Loading @@ -490,7 +491,7 @@ NMXP_META_CHAN_LIST *nmxp_meta_chan_add(NMXP_META_CHAN_LIST **chan_list, int32_t sorttype = NMXP_META_SORT_KEY; } new_item = (NMXP_META_CHAN_LIST *) malloc(sizeof(NMXP_META_CHAN_LIST)); new_item = (NMXP_META_CHAN_LIST *) NMXP_MEM_MALLOC(sizeof(NMXP_META_CHAN_LIST)); new_item->key = 0; new_item->name[0] = 0; new_item->start_time = 0; Loading
lib/nmxp_data.c +3 −2 Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_data.c,v 1.59 2008-03-24 20:29:28 mtheo Exp $ * $Id: nmxp_data.c,v 1.60 2008-03-28 13:21:24 mtheo Exp $ * */ #include "nmxp_data.h" #include "nmxp_log.h" #include "nmxp_memory.h" #include <stdio.h> #include <stdlib.h> Loading Loading @@ -698,7 +699,7 @@ int nmxp_data_msr_pack(NMXP_DATA_PROCESS *pd, NMXP_DATA_SEED *data_seed, void *p msr->sampletype = 'i'; /* declare type to be 32-bit integers */ msr->numsamples = pd->nSamp; msr->datasamples = malloc (sizeof(int) * (msr->numsamples)); msr->datasamples = NMXP_MEM_MALLOC (sizeof(int) * (msr->numsamples)); memcpy(msr->datasamples, pd->pDataPtr, sizeof(int) * pd->nSamp); /* pointer to 32-bit integer data samples */ msr_srcname (msr, data_seed->srcname, 0); Loading