- init pwalletMain and pcoinsdbview to NULL
- add or extend NULL pointer checks before deleting any of pblocktree, pcoinsTip, pcoinsdbview or pwalletMain
- change a LogPrintf for nScriptCheckThreads from unsigned to %d as it is an integer
add safety checks in init before calling delete #4912
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:init changing 1 files +34 −18-
Diapolo commented at 11:08 AM on September 14, 2014: none
-
f757d3ea1f
add safety checks in init before calling delete
- init pwalletMain and pcoinsdbview to NULL - add or extend NULL pointer checks before deleting any of pblocktree, pcoinsTip, pcoinsdbview or pwalletMain - change a LogPrintf for nScriptCheckThreads from unsigned to %d as it is an integer
-
BitcoinPullTester commented at 11:37 AM on September 14, 2014: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4912_f757d3ea1f3a39e911331076975b74095bfa7e62/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
-
sipa commented at 3:29 PM on September 14, 2014: member
Not a NAK, but just so you know, all of these are no ops:
- Global variables are always initialized to zero (though I don't mind making the initialization value more explicit).
- It is legal to delete a NULL.
- Tinyformat treats %u, %i and %d identically, and uses the actual data type to determine whether to use signed or unsigned conversion.
-
jgarzik commented at 1:27 AM on September 15, 2014: contributor
I don't mind more explicit init.
NAK on the added "if (foo) delete ..."
It is a standard janitor cleanup to remove such "if (...)" tests prior to delete or free(3).
-
laanwj commented at 7:01 AM on September 15, 2014: member
This is completely unnecessary...
- jgarzik closed this on Sep 15, 2014
- Diapolo deleted the branch on Sep 16, 2014
- MarcoFalke locked this on Sep 8, 2021
Contributors