-
-
Notifications
You must be signed in to change notification settings - Fork 265
Added multiple NULL and nullptr checks #8962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3368,7 +3368,8 @@ static void gen_t_start( const act* action, int column) | |
|
|
||
| if (trans->tra_db_count == 1) | ||
| { | ||
| printa(column, "%s = %s->startTransaction(%s, %d, fb_tpb_%d);", | ||
| if (trans->tra_tpb) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And what's else? Don't start the transaction at all?.. |
||
| printa(column, "%s = %s->startTransaction(%s, %d, fb_tpb_%d);", | ||
| trans->tra_handle ? trans->tra_handle : gpreGlob.transaction_name, | ||
| trans->tra_tpb->tpb_database->dbb_name->sym_string, vector, | ||
| trans->tra_tpb->tpb_length, trans->tra_tpb->tpb_ident); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1049,6 +1049,9 @@ static Lock* hash_get_lock(Lock* lock, USHORT* hash_slot, Lock*** prior) | |
|
|
||
| // if no collisions found, we're done | ||
|
|
||
| if (!att->att_compatibility_table) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return NULL; | ||
|
|
||
| Lock* match = (*att->att_compatibility_table)[hash_value]; | ||
| if (!match) | ||
| return NULL; | ||
|
|
@@ -1333,6 +1336,9 @@ static USHORT internal_downgrade(thread_db* tdbb, CheckStatusWrapper* statusVect | |
|
|
||
| // if we can convert to that level, set all identical locks as having that level | ||
|
|
||
| if (!first || !first->lck_physical) | ||
| return NULL; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not |
||
|
|
||
| if (level < first->lck_physical) | ||
| { | ||
| if (dbb->lockManager()->convert(tdbb, statusVector, first->lck_id, level, LCK_NO_WAIT, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -998,7 +998,7 @@ void Applier::storeBlob(thread_db* tdbb, TraNumber traNum, bid* blobId, | |
| fb_assert(blob->blb_flags & BLB_temporary); | ||
| fb_assert(!(blob->blb_flags & BLB_closed)); | ||
|
|
||
| if (length) | ||
| if (blob && length) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...and if |
||
| blob->BLB_put_segment(tdbb, data, length); | ||
| else | ||
| blob->BLB_close(tdbb); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dead code. The loop above makes sure that
stringis notnullptr.