Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  09 Jun 2012, Greg Christian, Bug Report, _net_send_buffer realloc 
    Reply  10 Jun 2012, Konstantin Olchanski, Bug Report, _net_send_buffer realloc 
       Reply  10 Jun 2012, Greg Christian, Bug Report, _net_send_buffer realloc 
          Reply  11 Jun 2012, Konstantin Olchanski, Bug Report, _net_send_buffer realloc 
    Reply  15 Jun 2012, Konstantin Olchanski, Bug Report, _net_send_buffer realloc 
Message ID: 791     Entry time: 10 Jun 2012     In reply to: 790     Reply to this: 792
Author: Konstantin Olchanski 
Topic: Bug Report 
Subject: _net_send_buffer realloc 
> In midas.c, ...
>
> 1) _net_send_buffer is not set to NULL when declared.

_net_send_buffer is a global variable. All global variables are automatically initialized to zero before the program 
starts.

static char*x; // = NULL; is redundant
char*y=realloc(x, 100);  // x is NULL, usage is correct

> 2) cm_disconect_experiment() calls free(_net_send_buffer) but does not set its 
> value to NULL.

My copy of midas.c (svn rev 5256) sets _net_send_buffer to NULL:

   if (_net_send_buffer_size > 0) { 
      M_FREE(_net_send_buffer); 
      _net_send_buffer_size = 0; 
   } 
 
What version of midas do you have? (svn info .)

K.O.
ELOG V3.1.4-2e1708b5