X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Fcommon%2Fmetadata%2Fobjstack.c;h=2f70380040f6050a8a1c283838c5c65cc8178d73;hb=68b66a256a54d32992dfefeaad11eea88b7df234;hp=de6760166e93f142c33b0f431ed874f01f360d70;hpb=3d9990ac8bcbb870300869ed217b80151b52bf4e;p=babeltrace.git diff --git a/plugins/ctf/common/metadata/objstack.c b/plugins/ctf/common/metadata/objstack.c index de676016..2f703800 100644 --- a/plugins/ctf/common/metadata/objstack.c +++ b/plugins/ctf/common/metadata/objstack.c @@ -24,10 +24,13 @@ * SOFTWARE. */ +#define BT_LOG_TAG "PLUGIN-CTF-METADATA-OBJSTACK" +#include "logging.h" + #include -#include -#include -#include +#include +#include +#include #define OBJSTACK_ALIGN 8 /* Object stack alignment */ #define OBJSTACK_INIT_LEN 128 @@ -51,11 +54,14 @@ struct objstack *objstack_create(void) struct objstack_node *node; objstack = calloc(1, sizeof(*objstack)); - if (!objstack) + if (!objstack) { + BT_LOGE_STR("Failed to allocate one object stack."); return NULL; + } 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; } @@ -107,6 +113,7 @@ struct objstack_node *objstack_append_node(struct objstack *objstack) 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);