pmc: Initialize variable on the stack.
Valgrind is complaining that the pmc program is using uninitialized data. Actually the data are partially initialized, but it can't hurt to zero the entire data structure. Doing so silences the valgrind warning, and after all it is good practice. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
8857ad9834
commit
d465406106
|
@ -66,8 +66,10 @@ struct pmc *pmc_create(struct config *cfg, enum transport_type transport_type,
|
||||||
UInteger8 domain_number, UInteger8 transport_specific,
|
UInteger8 domain_number, UInteger8 transport_specific,
|
||||||
int zero_datalen)
|
int zero_datalen)
|
||||||
{
|
{
|
||||||
struct pmc *pmc;
|
|
||||||
struct interface iface;
|
struct interface iface;
|
||||||
|
struct pmc *pmc;
|
||||||
|
|
||||||
|
memset(&iface, 0, sizeof(iface));
|
||||||
|
|
||||||
pmc = calloc(1, sizeof *pmc);
|
pmc = calloc(1, sizeof *pmc);
|
||||||
if (!pmc)
|
if (!pmc)
|
||||||
|
|
Loading…
Reference in New Issue