Dynamic memory, referenced by 'buf' is allocated by calling function 'xstrdup'
add then changed by calling of strsep function.
The free(buf) call is incorrect if buf != NULL, and points to some
place inside or outside the source string.
static void parse_securebits(struct privctx *opts, const char *arg)
{
char *buf = xstrdup(arg);
+ char *source_buf = buf;
char *c;
opts->have_securebits = 1;
opts->securebits |= SECBIT_KEEP_CAPS; /* We need it, and it's reset on exec */
- free(buf);
+ free(source_buf);
}
static void do_selinux_label(const char *label)