Skip to content

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

@tbzatek

Description

@tbzatek

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions