Thomas Haller <thaller@xxxxxxxxxx> wrote: > It's not a const pointer, as the destroy() function clearly > modifies/free is. Drop the const from the argument of > input_descriptor_destroy(). > > Signed-off-by: Thomas Haller <thaller@xxxxxxxxxx> > --- > src/scanner.l | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/scanner.l b/src/scanner.l > index 00a09485d420..31284d7358fa 100644 > --- a/src/scanner.l > +++ b/src/scanner.l > @@ -1258,11 +1258,11 @@ void *scanner_init(struct parser_state *state) > return scanner; > } > > -static void input_descriptor_destroy(const struct input_descriptor *indesc) > +static void input_descriptor_destroy(struct input_descriptor *indesc) > { > if (indesc->name) > free_const(indesc->name); > - free_const(indesc); > + free(indesc); I don't agree, this is fine as-is.