Skip to content

Commit e98066f

Browse files
authored
Merge pull request #50 from douzzer/20220708-attend-return-values
20220708-attend-return-values
2 parents cdbc580 + 6ec0ad1 commit e98066f

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)