Skip to content

secret-tool: Fix memory issues in lock command

Niels De Graef requested to merge nielsdg/fix-illegal-free-in-secret-tool into master

There were several issues in secret_tool_action_lock():

  • g_autolist (GList) isn't a correct type, as the list elements are SecretCollections, not GLists
  • Separately from that, the list didn't take ownership of the elements either in all cases
  • We were leaking the locked and context variables

This commits just does away with all the g_auto* usage as it's the only place in the code we're using it anyway, and just does all the freeing at the end of the function.

Fixes: 015ea119 ("secret-tool: Add locking capabilities to secret tool") Fixes: #89 (closed)

Merge request reports