- ptr = realloc (graph_list, sizeof (*graph_list) * (graph_list_length + 1));
- if (ptr == NULL)
- return (ENOMEM);
- graph_list = ptr;
-
- ptr = graph_list + graph_list_length;
- memset (ptr, 0, sizeof (*ptr));
- ptr->host = NULL;
- ptr->plugin = NULL;
- ptr->plugin_instance = NULL;
- ptr->type = NULL;
- ptr->type_instance = NULL;
-
-#define DUP_OR_BREAK(member) do { \
- ptr->member = NULL; \
- if (gl->member != NULL) \
- { \
- ptr->member = strdup (gl->member); \
- if (ptr->member == NULL) \
- break; \
- } \
-} while (0)
-
- status = ENOMEM;
- do
- {
- DUP_OR_BREAK(host);
- DUP_OR_BREAK(plugin);
- DUP_OR_BREAK(plugin_instance);
- DUP_OR_BREAK(type);
- DUP_OR_BREAK(type_instance);