Message ID | 20240510091814.3172988-7-hadess@hadess.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Fix a number of static analysis issues | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | fail | WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 4: B1 Line exceeds max length (96>80): "bluez-5.75/client/main.c:2108:2: alloc: Allocation of memory which must be freed using "g_free"." 5: B1 Line exceeds max length (112>80): "bluez-5.75/client/main.c:2108:2: assign: Assigning: "desc" = "g_strdup_printf("\x1b[0;94m[%s]\x1b[0m# ", attr)"." 6: B1 Line exceeds max length (125>80): "bluez-5.75/client/main.c:2111:2: free: Calling "free" frees "desc" using "free" but it should have been freed using "g_free"." 8: B3 Line contains hard tab characters (\t): "2110| bt_shell_set_prompt(desc);" 9: B3 Line contains hard tab characters (\t): "2111|-> free(desc);" |
diff --git a/client/main.c b/client/main.c index f703cc91b24a..f967c149e7bd 100644 --- a/client/main.c +++ b/client/main.c @@ -2113,7 +2113,7 @@ static void set_default_local_attribute(char *attr) desc = g_strdup_printf(COLOR_BLUE "[%s]" COLOR_OFF "# ", attr); bt_shell_set_prompt(desc); - free(desc); + g_free(desc); } static void cmd_select_attribute(int argc, char *argv[])