X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Ftracepoint.c;fp=liblttng-ust%2Ftracepoint.c;h=00c471969b4394f16b9ec2e13bb520e10e78fe4b;hb=9e9a9433164231ca4ab8849235d2d0399fa7efe5;hp=8c137a3892a99558d26ce4066db1c341e87639a4;hpb=9f65ef2fbe7ca97bd020e95cc18dc4b17517066b;p=lttng-ust.git diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index 8c137a38..00c47196 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -380,7 +380,10 @@ static void add_callsite(struct tracepoint_lib * lib, struct tracepoint *tp) hash = jhash(name, name_len, 0); head = &callsite_table[hash & (CALLSITE_TABLE_SIZE - 1)]; e = zmalloc(sizeof(struct callsite_entry)); - assert(e); + if (!e) { + PERROR("Unable to add callsite for tracepoint \"%s\"", name); + return; + } cds_hlist_add_head(&e->hlist, head); e->tp = tp; cds_list_add(&e->node, &lib->callsites); @@ -729,7 +732,10 @@ int tracepoint_register_lib(struct tracepoint * const *tracepoints_start, init_tracepoint(); pl = (struct tracepoint_lib *) zmalloc(sizeof(struct tracepoint_lib)); - + if (!pl) { + PERROR("Unable to register tracepoint lib"); + return -1; + } pl->tracepoints_start = tracepoints_start; pl->tracepoints_count = tracepoints_count; CDS_INIT_LIST_HEAD(&pl->callsites);