Commit c75d402c authored by Matteo Quintiliani's avatar Matteo Quintiliani

Fixed bug: free allocated memory in nmxp_raw_stream_free()


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@970 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 8420aad7
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp.c,v 1.78 2008-03-20 12:42:59 mtheo Exp $ * $Id: nmxp.c,v 1.79 2008-03-27 12:03:11 mtheo Exp $
* *
*/ */
...@@ -705,6 +705,12 @@ void nmxp_raw_stream_free(NMXP_RAW_STREAM_DATA *raw_stream_buffer) { ...@@ -705,6 +705,12 @@ void nmxp_raw_stream_free(NMXP_RAW_STREAM_DATA *raw_stream_buffer) {
if(raw_stream_buffer->pdlist) { if(raw_stream_buffer->pdlist) {
for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) { for(j=0; j<raw_stream_buffer->max_pdlist_items; j++) {
if(raw_stream_buffer->pdlist[j]) { if(raw_stream_buffer->pdlist[j]) {
if(raw_stream_buffer->pdlist[j]->buffer) {
free(raw_stream_buffer->pdlist[j]->buffer);
}
if(raw_stream_buffer->pdlist[j]->pDataPtr) {
free(raw_stream_buffer->pdlist[j]->pDataPtr);
}
free(raw_stream_buffer->pdlist[j]); free(raw_stream_buffer->pdlist[j]);
} }
} }
...@@ -932,7 +938,7 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int ...@@ -932,7 +938,7 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int
(*p_func_pd[i_func_pd])(p->pdlist[j]); (*p_func_pd[i_func_pd])(p->pdlist[j]);
} }
if(time_diff > TIME_TOLLERANCE || time_diff < -TIME_TOLLERANCE) { if(time_diff > TIME_TOLLERANCE || time_diff < -TIME_TOLLERANCE) {
nmxp_log(NMXP_LOG_WARN, NMXP_LOG_D_RAWSTREAM, nmxp_log(NMXP_LOG_ERR, NMXP_LOG_D_ANY,
"%s.%s.%s [%d, %d] (%s + %.2f sec.) * Time is not correct * last_seq_no_sent=%d seq_no_diff=%d time_diff=%.2fs lat. %.1fs\n", "%s.%s.%s [%d, %d] (%s + %.2f sec.) * Time is not correct * last_seq_no_sent=%d seq_no_diff=%d time_diff=%.2fs lat. %.1fs\n",
NMXP_LOG_STR(p->pdlist[j]->network), NMXP_LOG_STR(p->pdlist[j]->station), NMXP_LOG_STR(p->pdlist[j]->channel), NMXP_LOG_STR(p->pdlist[j]->network), NMXP_LOG_STR(p->pdlist[j]->station), NMXP_LOG_STR(p->pdlist[j]->channel),
p->pdlist[j]->packet_type, p->pdlist[j]->seq_no, p->pdlist[j]->packet_type, p->pdlist[j]->seq_no,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment