coverity scan CID 22555: sizeof not portable

wrong type in sizeof (pointer instead of struct)
This commit is contained in:
Enno Rehling 2015-10-29 08:45:48 +01:00
parent 185a2ee29c
commit 0328e84c6c

View file

@ -249,7 +249,7 @@ void add_translation(struct critbit_tree **cbp, const char *key, int i) {
size_t len = strlen(str); size_t len = strlen(str);
if (!cb) { if (!cb) {
// TODO: this will leak, because we do not know how to clean it up */ // TODO: this will leak, because we do not know how to clean it up */
*cbp = cb = (struct critbit_tree *)calloc(1, sizeof(struct critbit_tree *)); *cbp = cb = (struct critbit_tree *)calloc(1, sizeof(struct critbit_tree));
} }
len = cb_new_kv(str, len, &i, sizeof(int), buffer); len = cb_new_kv(str, len, &i, sizeof(int), buffer);
cb_insert(cb, buffer, len); cb_insert(cb, buffer, len);