Skip to content
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

RFE: Refactor lvm-dbus.c:call_lvm_method_sync() #910

Open
tbzatek opened this issue Jun 27, 2023 · 0 comments
Open

RFE: Refactor lvm-dbus.c:call_lvm_method_sync() #910

tbzatek opened this issue Jun 27, 2023 · 0 comments
Assignees
Labels

Comments

@tbzatek
Copy link
Member

tbzatek commented Jun 27, 2023

As many said before, this function is gross and needs to be refactored.

Error: UNREACHABLE ([CWE-561](https://cwe.mitre.org/data/definitions/561.html)): [[#def6]](https://cov01.lab.eng.brq2.redhat.com/osh/task/285206/log/libblockdev-2.99-195.fc38/scan-results.html#def6)
libblockdev-2.99/src/plugins/lvm-dbus.c:887: unreachable: This code cannot be reached: "g_free(task_path);".
#  885|           return FALSE;
#  886|       }
#  887|->     g_free (task_path);
#  888|   
#  889|       return TRUE;

This is true, but the code is prone to mistakes once somebody makes any change and don't realize all the returns along the way.

@tbzatek tbzatek added the RFE label Jun 27, 2023
@tbzatek tbzatek added this to the libblockdev 3.1 milestone Jun 27, 2023
@vojtechtrefny vojtechtrefny self-assigned this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants