Skip to content

Commit

Permalink
Free uuid in should_sync_... functions, fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier committed Nov 6, 2023
1 parent 9bde214 commit 4946139
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/manage_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);

Expand Down
11 changes: 9 additions & 2 deletions src/manage_port_lists.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);

Expand Down
11 changes: 9 additions & 2 deletions src/manage_report_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,18 @@ 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))
{
g_free (full_path);
return 1;
}
g_free (uuid);
g_free (full_path);
return 0;
}
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4946139

Please sign in to comment.