Skip to content
Snippets Groups Projects
Commit cf30c2c6 authored by moon2's avatar moon2 :speech_balloon:
Browse files

bl00mbox: no more memset

parent 4eb25bfb
No related branches found
No related tags found
No related merge requests found
Checks: '-clang-diagnostic-incompatible-pointer-types' Checks: '-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-diagnostic-deprecated-declarations,-clang-diagnostic-incompatible-pointer-types'
...@@ -388,7 +388,10 @@ bool bl00mbox_channel_connect_signal_to_output_mixer( ...@@ -388,7 +388,10 @@ bool bl00mbox_channel_connect_signal_to_output_mixer(
if (root == NULL) return false; if (root == NULL) return false;
bl00mbox_connection_subscriber_t *sub = bl00mbox_connection_subscriber_t *sub =
malloc(sizeof(bl00mbox_connection_subscriber_t)); malloc(sizeof(bl00mbox_connection_subscriber_t));
if (sub == NULL) return false; if (sub == NULL){
free(root);
return false;
}
bl00mbox_connection_t *conn; bl00mbox_connection_t *conn;
if (tx->buffer == NULL) { // doesn't feed a buffer yet if (tx->buffer == NULL) { // doesn't feed a buffer yet
...@@ -408,7 +411,11 @@ bool bl00mbox_channel_connect_signal_to_output_mixer( ...@@ -408,7 +411,11 @@ bool bl00mbox_channel_connect_signal_to_output_mixer(
if (conn->subs != NULL) { if (conn->subs != NULL) {
bl00mbox_connection_subscriber_t *seek = conn->subs; bl00mbox_connection_subscriber_t *seek = conn->subs;
while (seek != NULL) { 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; seek = seek->next;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment