summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnel Husakovic <anel@mariadb.org>2023-02-08 12:24:25 +0100
committerAndrew Hutchings <andrew@linuxjedi.co.uk>2023-02-17 13:43:43 +0000
commit24911a34b3409e0f18cf4ff7f695c902e39a9644 (patch)
treebf1294a722b39c875d46fe147875985b1e366d23
parent023bb2fc201eb53017a505e621ae40df28abf9e0 (diff)
downloadmariadb-git-24911a34b3409e0f18cf4ff7f695c902e39a9644.tar.gz
MDBF-534: Coverity scan: fix client folder
--------------------------------- File: `mysqlslap` --------------------------------- - Coverity (CHECKED_RETURN): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073524&mergedDefectId=1520114 - FALSE POSITIVES - Coverity (DC.WEAK_CRYPTO) (`random()`): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073112&mergedDefectId=1225806 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074491&mergedDefectId=1409160 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074151&mergedDefectId=1409180 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073799&mergedDefectId=1409183 - Coverity (TAINTED_SCALAR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074667&mergedDefectId=1519586 - Coverity (UNINT): - Coverity (BAD_FREE): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074415&mergedDefectId=1520371
-rw-r--r--client/mysqlslap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 8c65dccbb43..78e9b6aa646 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1768,6 +1768,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
uint x;
struct timeval start_time, end_time;
thread_context con;
+ int error;
pthread_t mainthread; /* Thread descriptor */
pthread_attr_t attr; /* Thread attributes */
DBUG_ENTER("run_scheduler");
@@ -1776,8 +1777,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
con.limit= limit;
pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,
- PTHREAD_CREATE_DETACHED);
+ if ((error= pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)))
+ {
+ printf("Got error: %d from pthread_attr_setdetachstate\n", error);
+ exit(1);
+ }
pthread_mutex_lock(&counter_mutex);
thread_counter= 0;