-
Notifications
You must be signed in to change notification settings - Fork 61
More static analysis issues fixes #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vojtechtrefny
merged 1 commit into
storaged-project:master
from
vojtechtrefny:master_static-analysis-fixes-2
Sep 24, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -693,7 +693,7 @@ static GVariant* call_lvm_method (const gchar *obj, const gchar *intf, const gch | |
| static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const gchar *method, GVariant *params, GVariant *extra_params, const BDExtraArg **extra_args, gboolean lock_config, GError **error) { | ||
| GVariant *ret = NULL; | ||
| gchar *obj_path = NULL; | ||
| gchar *task_path = NULL; | ||
| g_autofree gchar *task_path = NULL; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| guint64 log_task_id = 0; | ||
| guint64 prog_id = 0; | ||
| gdouble progress = 0.0; | ||
|
|
@@ -726,7 +726,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| g_free (log_msg); | ||
| /* got a valid result, just return */ | ||
| g_variant_unref (ret); | ||
| g_free (task_path); | ||
| g_free (obj_path); | ||
| bd_utils_report_finished (prog_id, "Completed"); | ||
| return TRUE; | ||
|
|
@@ -740,7 +739,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| method, obj, log_msg); | ||
| bd_utils_log_task_status (log_task_id, log_msg); | ||
| bd_utils_report_finished (prog_id, log_msg); | ||
| g_free (task_path); | ||
| g_free (log_msg); | ||
| return FALSE; | ||
| } | ||
|
|
@@ -751,7 +749,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| g_variant_unref (ret); | ||
| } else { | ||
| bd_utils_log_task_status (log_task_id, "No result, no job started"); | ||
| g_free (task_path); | ||
| bd_utils_report_finished (prog_id, "Completed"); | ||
| g_variant_unref (ret); | ||
| return TRUE; | ||
|
|
@@ -808,7 +805,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| method, obj); | ||
| bd_utils_report_finished (prog_id, l_error->message); | ||
| g_propagate_error (error, l_error); | ||
| g_free (task_path); | ||
| return FALSE; | ||
| } else { | ||
| g_variant_get (ret, "o", &obj_path); | ||
|
|
@@ -837,7 +833,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| "Got unknown error when running '%s' method on the '%s' object.", | ||
| method, obj); | ||
| } | ||
| g_free (task_path); | ||
| g_propagate_error (error, l_error); | ||
| return FALSE; | ||
| } else | ||
|
|
@@ -852,7 +847,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| if (ret) | ||
| g_variant_unref (ret); | ||
|
|
||
| g_free (task_path); | ||
| return TRUE; | ||
| } | ||
| } else { | ||
|
|
@@ -863,9 +857,6 @@ static gboolean call_lvm_method_sync (const gchar *obj, const gchar *intf, const | |
| bd_utils_report_finished (prog_id, "Completed"); | ||
| return FALSE; | ||
| } | ||
| g_free (task_path); | ||
|
vojtechtrefny marked this conversation as resolved.
|
||
|
|
||
| return TRUE; | ||
| } | ||
|
|
||
| static gboolean call_lvm_obj_method_sync (const gchar *obj_id, const gchar *intf, const gchar *method, GVariant *params, GVariant *extra_params, const BDExtraArg **extra_args, gboolean lock_config, GError **error) { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential
NULLpointer dereference here. Ifbd_fs_unmount()returnsFALSEbut fails to setlocal_error(which would be a bug inbd_fs_unmount, but defensive coding is good practice), accessinglocal_error->messagewill cause a crash. It's safer to check iflocal_errorisNULLbefore dereferencing it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BS! There's the code style and a certain trust in the code.