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
Richard Cochran 2018-03-30 10:29:30 -07:00
parent 8857ad9834
commit d465406106
1 changed files with 3 additions and 1 deletions

View File

@ -66,8 +66,10 @@ struct pmc *pmc_create(struct config *cfg, enum transport_type transport_type,
UInteger8 domain_number, UInteger8 transport_specific,
int zero_datalen)
{
struct pmc *pmc;
struct interface iface;
struct pmc *pmc;
memset(&iface, 0, sizeof(iface));
pmc = calloc(1, sizeof *pmc);
if (!pmc)