diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-09 13:38:33 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-09 13:38:48 +0100 |
commit | ef3758d1ef73f83f7646363f748010cdc5c2d7f2 (patch) | |
tree | d4fe48971da5f847303e902478518b38506cf761 /src | |
parent | 0ecc6305f464ff998f580c9ebd616ab42b4160bf (diff) | |
parent | b109a1c3962a9f45fb5819afd69c7caaf78eb35e (diff) |
Merge #10696: Remove redundant nullptr checks before deallocation
b109a1c Remove redundant nullptr checks before deallocation (practicalswift)
Pull request description:
Rationale:
* `delete ptr` is a no-op if `ptr` is `nullptr`
Tree-SHA512: c98ce769125c4912186a8403cc08a59cfba85b7141af645c709b4c4eb90dd9cbdd6ed8076d50099d1e4ec2bf75917d1af6844082ec42bbb4d94d229a710e051c
Diffstat (limited to 'src')
-rw-r--r-- | src/net.cpp | 3 | ||||
-rw-r--r-- | src/qt/paymentrequestplus.cpp | 3 | ||||
-rw-r--r-- | src/qt/paymentserver.cpp | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 935cb81901..d5bd4c162b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2778,8 +2778,7 @@ CNode::~CNode() { CloseSocket(hSocket); - if (pfilter) - delete pfilter; + delete pfilter; } void CNode::AskFor(const CInv& inv) diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index d3799f59ab..c7f92a0921 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -194,8 +194,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c qWarning() << "PaymentRequestPlus::getMerchant: SSL error: " << err.what(); } - if (website) - delete[] website; + delete[] website; X509_STORE_CTX_free(store_ctx); for (unsigned int i = 0; i < certs.size(); i++) X509_free(certs[i]); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 169684cf6d..506e49af0d 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -362,8 +362,7 @@ void PaymentServer::initNetManager() { if (!optionsModel) return; - if (netManager != nullptr) - delete netManager; + delete netManager; // netManager is used to fetch paymentrequests given in bitcoin: URIs netManager = new QNetworkAccessManager(this); |