diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f28b10fa..98c5a44d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,6 +119,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Deprecated ### Removed ### Fixed +- Fix memory errors in modify_permission [#1613](https://github.com/greenbone/gvmd/pull/1613) [Unreleased]: https://github.com/greenbone/gvmd/compare/v20.8.2...gvmd-20.08 diff --git a/src/manage_sql.c b/src/manage_sql.c index 5beddfbc0..cb156235f 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -43631,6 +43631,7 @@ modify_permission (const char *permission_id, const char *name_arg, free (new_resource_id); free (existing_subject_type); free (new_subject_id); + g_free (subject_where_old); sql_rollback (); return ret; } @@ -43683,7 +43684,6 @@ modify_permission (const char *permission_id, const char *name_arg, || (resource_id == NULL)); quoted_name = sql_quote (name); - g_free (name); sql ("UPDATE permissions SET" " name = '%s'," @@ -43767,6 +43767,7 @@ modify_permission (const char *permission_id, const char *name_arg, free (new_resource_id); free (existing_subject_type); free (new_subject_id); + g_free (name); free (old_name); free (old_resource_type); g_free (subject_where);