On Thu, Dec 17, 2020 at 4:02 PM Jakub Hrozek <jhrozek@xxxxxxxxxx> wrote: > > semanage_direct_remove allocates struct semanage_module_key_t on > stack, then calls semanage_module_key_set_name which allocates > modkey->name on heap, but modkey->name wasn't free()-d anywhere, > creating a small leak. > > Signed-off-by: Jakub Hrozek <jhrozek@xxxxxxxxxx> Thanks for your patch! Acked-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> I merged it directly. Nicolas > --- > libsemanage/src/direct_api.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c > index d2b91fb2..9a4e7938 100644 > --- a/libsemanage/src/direct_api.c > +++ b/libsemanage/src/direct_api.c > @@ -1951,6 +1951,7 @@ static int semanage_direct_remove(semanage_handle_t * sh, char *module_name) > status = semanage_direct_remove_key(sh, &modkey); > > cleanup: > + semanage_module_key_destroy(sh, &modkey); > return status; > } > > -- > 2.26.2 >