Skip to content

Commit

Permalink
update(libsinsp): fix reduced_ variable names
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra authored and poiana committed Feb 17, 2023
1 parent 064bc75 commit abcacf9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions userspace/libsinsp/filterchecks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5242,12 +5242,12 @@ uint8_t* sinsp_filter_check_tracer::extract_args(sinsp_partial_tracer* pae, OUT

if(m_storage_size < encoded_args_len)
{
char *reduced_storage = (char*)realloc(m_storage, encoded_args_len);
if(reduced_storage == NULL)
char *new_storage = (char*)realloc(m_storage, encoded_args_len);
if(new_storage == NULL)
{
return NULL;
}
m_storage = reduced_storage;
m_storage = new_storage;
m_storage_size = encoded_args_len;
}

Expand Down Expand Up @@ -5402,12 +5402,12 @@ uint8_t* sinsp_filter_check_tracer::extract(sinsp_evt *evt, OUT uint32_t* len, b

if(m_storage_size < encoded_tags_len)
{
char *reduced_storage = (char*)realloc(m_storage, encoded_tags_len);
if(reduced_storage == NULL)
char *new_storage = (char*)realloc(m_storage, encoded_tags_len);
if(new_storage == NULL)
{
return NULL;
}
m_storage = reduced_storage;
m_storage = new_storage;
m_storage_size = encoded_tags_len;
}

Expand Down Expand Up @@ -5891,12 +5891,12 @@ inline uint8_t* sinsp_filter_check_evtin::extract_tracer(sinsp_evt *evt, sinsp_p

if(m_storage_size < encoded_tags_len)
{
char *reduced_storage = (char*)realloc(m_storage, encoded_tags_len);
if(reduced_storage == NULL)
char *new_storage = (char*)realloc(m_storage, encoded_tags_len);
if(new_storage == NULL)
{
return NULL;
}
m_storage = reduced_storage;
m_storage = new_storage;
m_storage_size = encoded_tags_len;
}

Expand Down Expand Up @@ -5957,12 +5957,12 @@ inline uint8_t* sinsp_filter_check_evtin::extract_tracer(sinsp_evt *evt, sinsp_p

if(m_storage_size < encoded_args_len)
{
char *reduced_storage = (char*)realloc(m_storage, encoded_args_len);
if(reduced_storage == NULL)
char *new_storage = (char*)realloc(m_storage, encoded_args_len);
if(new_storage == NULL)
{
return NULL;
}
m_storage = reduced_storage;
m_storage = new_storage;
m_storage_size = encoded_args_len;
}

Expand Down
6 changes: 3 additions & 3 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ sinsp_parser::~sinsp_parser()

void sinsp_parser::init_scapevt(metaevents_state& evt_state, uint16_t evt_type, uint16_t buf_size)
{
scap_evt *reduced_piscapevt = (scap_evt*) realloc(evt_state.m_piscapevt, buf_size);
if(reduced_piscapevt == NULL)
scap_evt *new_piscapevt = (scap_evt*) realloc(evt_state.m_piscapevt, buf_size);
if(new_piscapevt == NULL)
{
throw sinsp_exception("memory reallocation error in sinsp_parser::init_scapevt.");
}
evt_state.m_piscapevt = reduced_piscapevt;
evt_state.m_piscapevt = new_piscapevt;
evt_state.m_scap_buf_size = buf_size;
evt_state.m_piscapevt->type = evt_type;
evt_state.m_metaevt.m_pevt = evt_state.m_piscapevt;
Expand Down
18 changes: 9 additions & 9 deletions userspace/libsinsp/tracers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,13 +1229,13 @@ inline void sinsp_tracerparser::init_partial_tracer(sinsp_partial_tracer* pae)

if(pae->m_tags_storage_size < encoded_tags_len)
{
char *reduced_tags_storage = (char*)realloc(pae->m_tags_storage, encoded_tags_len);
if(reduced_tags_storage == NULL)
char *new_tags_storage = (char*)realloc(pae->m_tags_storage, encoded_tags_len);
if(new_tags_storage == NULL)
{
free(pae->m_tags_storage);
throw sinsp_exception("memory reallocation error in sinsp_tracerparser::init_partial_tracer.");
}
pae->m_tags_storage = reduced_tags_storage;
pae->m_tags_storage = new_tags_storage;
pae->m_tags_storage_size = encoded_tags_len;
}

Expand All @@ -1262,13 +1262,13 @@ inline void sinsp_tracerparser::init_partial_tracer(sinsp_partial_tracer* pae)

if(pae->m_argnames_storage_size < encoded_argnames_len)
{
char *reduced_argnames_storage = (char*)realloc(pae->m_argnames_storage, encoded_argnames_len);
if(reduced_argnames_storage == NULL)
char *new_argnames_storage = (char*)realloc(pae->m_argnames_storage, encoded_argnames_len);
if(new_argnames_storage == NULL)
{
free(pae->m_argnames_storage);
throw sinsp_exception("memory reallocation error in sinsp_tracerparser::init_partial_tracer.");
}
pae->m_argnames_storage = reduced_argnames_storage;
pae->m_argnames_storage = new_argnames_storage;
pae->m_argnames_storage_size = encoded_argnames_len;
}

Expand All @@ -1294,13 +1294,13 @@ inline void sinsp_tracerparser::init_partial_tracer(sinsp_partial_tracer* pae)

if(pae->m_argvals_storage_size < encoded_argvals_len)
{
char *reduced_argvals_storage = (char*)realloc(pae->m_argvals_storage, encoded_argvals_len);
if(reduced_argvals_storage == NULL)
char *new_argvals_storage = (char*)realloc(pae->m_argvals_storage, encoded_argvals_len);
if(new_argvals_storage == NULL)
{
free(pae->m_argvals_storage);
throw sinsp_exception("memory reallocation error in sinsp_tracerparser::init_partial_tracer.");
}
pae->m_argvals_storage = reduced_argvals_storage;
pae->m_argvals_storage = new_argvals_storage;
pae->m_argvals_storage_size = encoded_argvals_len;
}

Expand Down

0 comments on commit abcacf9

Please sign in to comment.