Hello,
during my work on the memory allocation topic I think I found a bug in the module
(xhttp_prom) in the file (prom_metric.c) at line 823. There is an if else and in both
parameters have the same code for shm_malloc() but in the else in the notes it reference
for pkg_malloc but is also shm_malloc. If you also think its an error, I will fix it.
//-----------------------------------------------------------------------------code
/* Allocate space for str. */
if (shared_mem) {
/* Shared memory */
/* We left space for zero at the end. */
lb_node->n.s = (char*)shm_malloc(len + 1);
if (lb_node->n.s == NULL) {
SHM_MEM_ERROR;
goto error;
}
memcpy(lb_node->n.s, s, len);
lb_node->n.len = len;
} else {
/* Pkg memory */
/* We left space for zero at the end. */
lb_node->n.s = (char*)shm_malloc(len + 1);//<--TODO--pantelis
if (lb_node->n.s == NULL) {
SHM_MEM_ERROR;
goto error;
}
memcpy(lb_node->n.s, s, len);
lb_node->n.len = len;
} /* if shared_mem */
//-------------------------------------------------------------------------------------------------------
Best Regard
Pantelis Kolatsis
Show replies by date