X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Fmarker.c;h=3351726aaa17954e2dcbb4169836032c4c326060;hb=1dba3e6c054da18f238d051da5b1839bd5e4e4dd;hp=4dc7de1c8b7a13d538727abdedfcc247510728f6;hpb=f7b16408b00ecce757bdde940853a48534b25edd;p=ust.git diff --git a/libust/marker.c b/libust/marker.c index 4dc7de1..3351726 100644 --- a/libust/marker.c +++ b/libust/marker.c @@ -428,10 +428,10 @@ static struct marker_entry *add_marker(const char *channel, const char *name, } } /* - * Using malloc here to allocate a variable length element. Could + * Using zmalloc here to allocate a variable length element. Could * cause some memory fragmentation if overused. */ - e = malloc(sizeof(struct marker_entry) + e = zmalloc(sizeof(struct marker_entry) + channel_len + name_len + format_len); if (!e) return ERR_PTR(-ENOMEM); @@ -439,7 +439,7 @@ static struct marker_entry *add_marker(const char *channel, const char *name, e->name = &e->channel[channel_len]; memcpy(e->name, name, name_len); if (format) { - e->format = &e->name[channel_len + name_len]; + e->format = &e->name[name_len]; memcpy(e->format, format, format_len); if (strcmp(e->format, MARK_NOARGS) == 0) e->call = marker_probe_cb_noarg; @@ -1363,7 +1363,7 @@ int marker_register_lib(struct marker *markers_start, int markers_count) { struct lib *pl; - pl = (struct lib *) malloc(sizeof(struct lib)); + pl = (struct lib *) zmalloc(sizeof(struct lib)); pl->markers_start = markers_start; pl->markers_count = markers_count;