Dynamic memory, referenced by 'my_caps' is allocated by calling function 'xstrdup'
add then changed by calling of strsep function.
The free(my_caps) call is incorrect if my_caps != NULL, and points to some
place inside or outside the source string.
Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
static void do_caps(enum cap_type type, const char *caps)
{
char *my_caps = xstrdup(caps);
+ char *source_my_caps = my_caps;
char *c;
while ((c = strsep(&my_caps, ","))) {
}
}
- free(my_caps);
+ free(source_my_caps);
}
static void parse_securebits(struct privctx *opts, const char *arg)