Skip to content

Commit 6ec0ad1

Browse files
committed
global fixup to check or explicitly ignore return values from failable library/system calls that weren't already being checked.
1 parent cdbc580 commit 6ec0ad1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

wolfcrypt/src/async.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,13 +933,18 @@ int wc_AsyncThreadCreate_ex(pthread_t *thread,
933933

934934
/*destroy the thread attributes as they are no longer required, this does
935935
* not affect the created thread*/
936-
pthread_attr_destroy(&attr);
937-
return 0;
936+
status = pthread_attr_destroy(&attr);
937+
if (status != 0) {
938+
fprintf(stderr, "AsyncThreadCreate error: %d\n", status);
939+
return ASYNC_OP_E;
940+
} else {
941+
return 0;
942+
}
938943

939944
exit_fail:
940945

941946
fprintf(stderr, "AsyncThreadCreate error: %d\n", status);
942-
pthread_attr_destroy(&attr);
947+
(void)pthread_attr_destroy(&attr);
943948
return ASYNC_OP_E;
944949
}
945950

0 commit comments

Comments
 (0)