Message ID | 20240530150057.444585-9-hadess@hadess.net (mailing list archive) |
---|---|
State | Accepted |
Commit | cc8e6ef63509ff69f8b2399802c6de320e957c2b |
Headers | show |
Series | Fix a number of static analysis issues #3 | 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 (201>80): "bluez-5.76/profiles/audio/bap.c:1166:4: alloc_arg: "asprintf" allocates memory that is stored into "path". [Note: The source code implementation of the function has been overridden by a builtin model.]" 5: B1 Line exceeds max length (122>80): "bluez-5.76/profiles/audio/bap.c:1178:5: leaked_storage: Variable "path" going out of scope leaks the storage it points to." 6: B3 Line contains hard tab characters (\t): "1176| free(l3_caps);" 7: B3 Line contains hard tab characters (\t): "1177| ret = false;" 8: B3 Line contains hard tab characters (\t): "1178|-> goto group_fail;" 9: B3 Line contains hard tab characters (\t): "1179| }" 13: B1 Line exceeds max length (201>80): "bluez-5.76/profiles/audio/bap.c:1166:4: alloc_arg: "asprintf" allocates memory that is stored into "path". [Note: The source code implementation of the function has been overridden by a builtin model.]" 14: B1 Line exceeds max length (122>80): "bluez-5.76/profiles/audio/bap.c:1199:5: leaked_storage: Variable "path" going out of scope leaks the storage it points to." 16: B3 Line contains hard tab characters (\t): "1198| if (matched_lpac == NULL || merged_caps == NULL)" 17: B3 Line contains hard tab characters (\t): "1199|-> continue;" 19: B3 Line contains hard tab characters (\t): "1201| create_stream_for_bis(bap_data, matched_lpac, qos," |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 3fcf21df58aa..53e7b3e34378 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1174,6 +1174,7 @@ static bool parse_base(struct bap_data *bap_data, struct bt_iso_base *base, if (!util_iov_pull_u8(&iov, (void *)&l3_caps->iov_len)) { free(l3_caps); + free(path); ret = false; goto group_fail; } @@ -1195,8 +1196,10 @@ static bool parse_base(struct bap_data *bap_data, struct bt_iso_base *base, l2_caps, l3_caps, &matched_lpac, &merged_caps); - if (matched_lpac == NULL || merged_caps == NULL) + if (matched_lpac == NULL || merged_caps == NULL) { + free(path); continue; + } create_stream_for_bis(bap_data, matched_lpac, qos, merged_caps, meta, path);