summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-05-17 15:16:24 +0200
committerSergei Golubchik <serg@mariadb.org>2017-05-19 20:26:56 +0200
commit7c03edf2fe66855a8ce8f2575c3aaf66af975377 (patch)
tree7e793f937b759c8808668c8924b71a962f9b21f8 /mysys
parent335c4ab790254462753ba4ed8b074c5847b2708f (diff)
downloadmariadb-git-7c03edf2fe66855a8ce8f2575c3aaf66af975377.tar.gz
MDEV-6262 analyze the coverity report on mariadb
uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_hash.c3
-rw-r--r--mysys/ma_dyncol.c1
-rw-r--r--mysys/waiting_threads.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 0699f5d49fe..7edf5e3a03d 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -485,7 +485,10 @@ static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node,
return -1;
if (*el == NULL && bucket &&
unlikely(initialize_bucket(hash, el, parent, pins)))
+ {
+ my_free(dummy);
return -1;
+ }
dummy->hashnr= my_reverse_bits(bucket) | 0; /* dummy node */
dummy->key= dummy_key;
dummy->keylen= 0;
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index 85c0b947497..d0d6254d11c 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -4039,6 +4039,7 @@ mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val)
*dbl= strtod(str, &end);
if (*end != '\0')
rc= ER_DYNCOL_TRUNCATED;
+ free(str);
break;
}
case DYN_COL_DECIMAL:
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c
index 1fe6a0f9a1c..f2b1bbb5993 100644
--- a/mysys/waiting_threads.c
+++ b/mysys/waiting_threads.c
@@ -561,7 +561,7 @@ my_bool wt_resource_id_memcmp(const void *a, const void *b)
{
/* we use the fact that there's no padding in the middle of WT_RESOURCE_ID */
compile_time_assert(offsetof(WT_RESOURCE_ID, type) == sizeof(ulonglong));
- return memcmp(a, b, sizeof_WT_RESOURCE_ID);
+ return MY_TEST(memcmp(a, b, sizeof_WT_RESOURCE_ID));
}
/**