libpmc: silence scan-build warnings

This commit is contained in:
Matt Macy 2018-05-29 21:02:13 +00:00
parent 5244f3c6ae
commit 8bed125da7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334354
2 changed files with 4 additions and 3 deletions

View file

@ -156,11 +156,12 @@ static int
pmu_parse_event(struct pmu_event_desc *ped, const char *eventin)
{
char *event;
char *kvp, *key, *value;
char *kvp, *key, *value, *r;
char *debug;
if ((event = strdup(eventin)) == NULL)
return (ENOMEM);
r = event;
bzero(ped, sizeof(*ped));
while ((kvp = strsep(&event, ",")) != NULL) {
key = strsep(&kvp, "=");
@ -199,7 +200,7 @@ pmu_parse_event(struct pmu_event_desc *ped, const char *eventin)
printf("unrecognized kvpair: %s:%s\n", key, value);
}
}
free(event);
free(r);
return (0);
}

View file

@ -136,7 +136,7 @@ pmclog_get_record(struct pmclog_parse_state *ps, char **data, ssize_t *len)
return (ps->ps_state = PL_STATE_ERROR);
src = *data;
h = used = 0;
used = 0;
if (ps->ps_state == PL_STATE_NEW_RECORD)
ps->ps_svcount = 0;