diff --git a/components/bl00mbox/.clang-tidy b/components/bl00mbox/.clang-tidy index cce6d6580cdce9acd11b8e37618f00bafd773c8d..8797ef9f00e0c9fa8a20af5f8ee4e1931ea5b1e4 100644 --- a/components/bl00mbox/.clang-tidy +++ b/components/bl00mbox/.clang-tidy @@ -1 +1 @@ -Checks: '-clang-diagnostic-incompatible-pointer-types' +Checks: '-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-diagnostic-deprecated-declarations,-clang-diagnostic-incompatible-pointer-types' diff --git a/components/bl00mbox/bl00mbox_user.c b/components/bl00mbox/bl00mbox_user.c index ba72abf923a1d8b974e6f9980ba65b0fc6a3cfb3..1544915dd97e5c23248c93f9363eefe5c1f92cc5 100644 --- a/components/bl00mbox/bl00mbox_user.c +++ b/components/bl00mbox/bl00mbox_user.c @@ -388,7 +388,10 @@ bool bl00mbox_channel_connect_signal_to_output_mixer( if (root == NULL) return false; bl00mbox_connection_subscriber_t *sub = malloc(sizeof(bl00mbox_connection_subscriber_t)); - if (sub == NULL) return false; + if (sub == NULL){ + free(root); + return false; + } bl00mbox_connection_t *conn; if (tx->buffer == NULL) { // doesn't feed a buffer yet @@ -408,7 +411,11 @@ bool bl00mbox_channel_connect_signal_to_output_mixer( if (conn->subs != NULL) { bl00mbox_connection_subscriber_t *seek = conn->subs; while (seek != NULL) { - if (seek->type == 1) return false; // already connected + if (seek->type == 1){ + free(root); + free(sub); + return false; // already connected + } seek = seek->next; } }