mirror of https://github.com/xzeldon/htop.git
Fix a PCP diagnostics typo, add missing pmFreeResult null check.
This commit is contained in:
parent
6f9b161b24
commit
e3d0fc1a5a
|
@ -377,7 +377,7 @@ bool Metric_fetch(struct timeval *timestamp) {
|
||||||
int sts = pmFetch(pcp->total, pcp->fetch, &pcp->result);
|
int sts = pmFetch(pcp->total, pcp->fetch, &pcp->result);
|
||||||
if (sts < 0) {
|
if (sts < 0) {
|
||||||
if (pmDebugOptions.appl0)
|
if (pmDebugOptions.appl0)
|
||||||
fprintf(stderr, "Error: cannot fetch metric values): %s\n",
|
fprintf(stderr, "Error: cannot fetch metric values: %s\n",
|
||||||
pmErrStr(sts));
|
pmErrStr(sts));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,8 @@ void Platform_init(void) {
|
||||||
|
|
||||||
void Platform_done(void) {
|
void Platform_done(void) {
|
||||||
pmDestroyContext(pcp->context);
|
pmDestroyContext(pcp->context);
|
||||||
pmFreeResult(pcp->result);
|
if (pcp->result)
|
||||||
|
pmFreeResult(pcp->result);
|
||||||
free(pcp->release);
|
free(pcp->release);
|
||||||
free(pcp->fetch);
|
free(pcp->fetch);
|
||||||
free(pcp->pmids);
|
free(pcp->pmids);
|
||||||
|
|
Loading…
Reference in New Issue