Coverity did detect that the cleaning code is only reached with
Dataset *set being initialized so the check is useless.
** CID
1649392: Null pointer dereferences (REVERSE_INULL)
/src/datasets-context-json.c: 719 in DatajsonGet()
>>> Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
** CID
1649391: Null pointer dereferences (REVERSE_INULL)
/src/datasets.c: 526 in DatasetGet()
>>> Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
DatasetUnlock();
return set;
out_err:
- if (set) {
- if (set->hash) {
- THashShutdown(set->hash);
- }
- SCFree(set);
+ if (set->hash) {
+ THashShutdown(set->hash);
}
+ SCFree(set);
DatasetUnlock();
return NULL;
}
DatasetUnlock();
return set;
out_err:
- if (set) {
- if (set->hash) {
- THashShutdown(set->hash);
- }
- SCFree(set);
+ if (set->hash) {
+ THashShutdown(set->hash);
}
+ SCFree(set);
DatasetUnlock();
return NULL;
}