[lttng-dev] [BUG] lttng-sessiond
Hannes Weisbach
hannes.weisbach at mailbox.tu-dresden.de
Sat Apr 25 10:37:17 EDT 2015
>
> Why do you need to load those explicitly ? They should be
> already loaded by default. I don't get those errors here.
> Which shell are you using (sh symlink) ? Can you reproduce
> using bash ?
Ok. Found the bug. In append_list_to_probes() index is used to get
the current index into the probes array. However in the loop, index
is never incremented. Therefore, the first entry of probes is
overwritten, but nr_probes is incremented, and later those "empty"
entries are referenced.
There is also a memory leak in append_list_to_probes():
tmp_list = strdup(list); // uses malloc()
next = strtok(tmp_list, ","); // tmp_list needs to be NULL except in the first iteration
tmp_list = NULL; // so set it NULL
free(tmp_list); // good intention, does not work.
Best regards,
Hannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150425/3a0dfd04/attachment.sig>
More information about the lttng-dev
mailing list