1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

super_node: fix nullptr dereference if no config was loaded

This commit is contained in:
Steffen Vogel 2018-10-25 17:02:59 +01:00
parent 25ff130377
commit 1ad92dca28

View file

@ -51,7 +51,8 @@ SuperNode::SuperNode() :
hugepages(DEFAULT_NR_HUGEPAGES),
stats(0),
api(this),
web(&api)
web(&api),
json(nullptr)
{
list_init(&nodes);
list_init(&paths);
@ -467,7 +468,8 @@ SuperNode::~SuperNode()
list_destroy(&paths, (dtor_cb_t) path_destroy, true);
list_destroy(&nodes, (dtor_cb_t) node_destroy, true);
json_decref(json);
if (json)
json_decref(json);
}
int SuperNode::periodic()