diff options
-rw-r--r-- | Settings.c | 5 | ||||
-rw-r--r-- | pcp/Instance.c | 4 |
2 files changed, 6 insertions, 3 deletions
@@ -543,9 +543,10 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini if (screen) screen->allBranchesCollapsed = atoi(option[1]); } else if (String_eq(option[0], ".dynamic")) { - if (screen) + if (screen) { free_and_xStrdup(&screen->dynamic, option[1]); - Platform_addDynamicScreen(screen); + Platform_addDynamicScreen(screen); + } } String_freeArray(option); } diff --git a/pcp/Instance.c b/pcp/Instance.c index e70e7b70..1515dfe6 100644 --- a/pcp/Instance.c +++ b/pcp/Instance.c @@ -62,10 +62,12 @@ static void Instance_writeField(const Row* super, RichString* str, RowField fiel const Settings* settings = super->host->settings; DynamicColumn* column = Hashtable_get(settings->dynamicColumns, field); PCPDynamicColumn* cp = (PCPDynamicColumn*) column; - const pmDesc* descp = Metric_desc(cp->id); + if (!cp) + return; pmAtomValue atom; pmAtomValue *ap = &atom; + const pmDesc* descp = Metric_desc(cp->id); if (!Metric_instance(cp->id, instid, this->offset, ap, descp->type)) ap = NULL; |