From 982941b0acc877af627a6fc9b86c199d601c691a Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Mon, 6 Nov 2023 15:56:15 +0100 Subject: [PATCH] Free uuid in should_sync_... functions, fix typo --- src/manage_configs.c | 12 ++++++++++-- src/manage_port_lists.c | 11 +++++++++-- src/manage_report_formats.c | 11 +++++++++-- src/manage_sql.c | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/manage_configs.c b/src/manage_configs.c index 02cae9e8a8..e88f7b0232 100644 --- a/src/manage_configs.c +++ b/src/manage_configs.c @@ -345,14 +345,19 @@ should_sync_config_from_path (const char *path, gboolean rebuild, find_config_no_acl (uuid, config); if (rebuild) - return 1; + { + g_free (uuid); + return 1; + } full_path = g_build_filename (feed_dir_configs (), path, NULL); if (deprecated_config_id_updated_in_feed (uuid, full_path)) { + g_free (uuid); g_free (full_path); return 1; } + g_free (uuid); g_free (full_path); return 0; } @@ -361,7 +366,10 @@ should_sync_config_from_path (const char *path, gboolean rebuild, && *config) { if (rebuild) - return 1; + { + g_free (uuid); + return 1; + } full_path = g_build_filename (feed_dir_configs (), path, NULL); diff --git a/src/manage_port_lists.c b/src/manage_port_lists.c index 843238929c..39f2d17758 100644 --- a/src/manage_port_lists.c +++ b/src/manage_port_lists.c @@ -282,14 +282,18 @@ should_sync_port_list_from_path (const char *path, gboolean rebuild, find_port_list_no_acl (uuid, port_list); if (rebuild) - return 1; + { + return 1; + } full_path = g_build_filename (feed_dir_port_lists (), path, NULL); if (deprecated_port_list_id_updated_in_feed (uuid, full_path)) { + g_free (uuid); g_free (full_path); return 1; } + g_free (uuid); g_free (full_path); return 0; } @@ -298,7 +302,10 @@ should_sync_port_list_from_path (const char *path, gboolean rebuild, && *port_list) { if (rebuild) - return 1; + { + g_free (uuid); + return 1; + } full_path = g_build_filename (feed_dir_port_lists (), path, NULL); diff --git a/src/manage_report_formats.c b/src/manage_report_formats.c index 4da8449802..3403211890 100644 --- a/src/manage_report_formats.c +++ b/src/manage_report_formats.c @@ -643,7 +643,10 @@ should_sync_report_format_from_path (const char *path, find_report_format_no_acl (uuid, report_format); if (rebuild) - return 1; + { + g_free (uuid); + return 1; + } full_path = g_build_filename (feed_dir_report_formats (), path, NULL); if (deprecated_report_format_id_updated_in_feed (uuid, full_path)) @@ -651,6 +654,7 @@ should_sync_report_format_from_path (const char *path, g_free (full_path); return 1; } + g_free (uuid); g_free (full_path); return 0; } @@ -659,7 +663,10 @@ should_sync_report_format_from_path (const char *path, && *report_format) { if (rebuild) - return 1; + { + g_free (uuid); + return 1; + } full_path = g_build_filename (feed_dir_report_formats (), path, NULL); diff --git a/src/manage_sql.c b/src/manage_sql.c index f031f64631..bffd66d59f 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -4774,7 +4774,7 @@ resource_id_deprecated (const char *type, const char *resource_id) } /** - * @brief Mark whether resource as deprecated. + * @brief Mark whether resource is deprecated. * * @param[in] type Resource type. * @param[in] resource_id UUID of the resource.