Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+#define BT_LOG_TAG "PLUGIN-CTF-METADATA-OBJSTACK"
+#include "logging.h"
+
#include <stdlib.h>
#include <babeltrace/list-internal.h>
#include <babeltrace/babeltrace-internal.h>
#include <stdlib.h>
#include <babeltrace/list-internal.h>
#include <babeltrace/babeltrace-internal.h>
struct objstack_node *node;
objstack = calloc(1, sizeof(*objstack));
struct objstack_node *node;
objstack = calloc(1, sizeof(*objstack));
+ if (!objstack) {
+ BT_LOGE_STR("Failed to allocate one object stack.");
node = calloc(sizeof(struct objstack_node) + OBJSTACK_INIT_LEN,
sizeof(char));
if (!node) {
node = calloc(sizeof(struct objstack_node) + OBJSTACK_INIT_LEN,
sizeof(char));
if (!node) {
+ BT_LOGE_STR("Failed to allocate one object stack node.");
free(objstack);
return NULL;
}
free(objstack);
return NULL;
}
new_node = calloc(sizeof(struct objstack_node) + (last_node->len << 1),
sizeof(char));
if (!new_node) {
new_node = calloc(sizeof(struct objstack_node) + (last_node->len << 1),
sizeof(char));
if (!new_node) {
+ BT_LOGE_STR("Failed to allocate one object stack node.");
return NULL;
}
bt_list_add_tail(&new_node->node, &objstack->head);
return NULL;
}
bt_list_add_tail(&new_node->node, &objstack->head);