Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-04-22 20:50:28 +0300
committerAdam Langley <agl@google.com>2015-05-05 02:05:17 +0300
commit22ccc2d8f1e0a3d19b98324d502322db8d89624f (patch)
tree634d6618b5a8d25cbddb5e080840f09a58657027 /crypto/bytestring
parentde95d262ab448f8582b8192c3a94e9c10acdb771 (diff)
Remove unnecessary NULL checks, part 1.
First batch of the alphabet. Change-Id: If4e60f4fbb69e04eb4b70aa1b2240e329251bfa5 Reviewed-on: https://boringssl-review.googlesource.com/4514 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bytestring')
-rw-r--r--crypto/bytestring/cbb.c2
-rw-r--r--crypto/bytestring/cbs.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/crypto/bytestring/cbb.c b/crypto/bytestring/cbb.c
index e146727b..f1e09a2a 100644
--- a/crypto/bytestring/cbb.c
+++ b/crypto/bytestring/cbb.c
@@ -66,7 +66,7 @@ int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) {
void CBB_cleanup(CBB *cbb) {
if (cbb->base) {
- if (cbb->base->buf && cbb->base->can_resize) {
+ if (cbb->base->can_resize) {
OPENSSL_free(cbb->base->buf);
}
OPENSSL_free(cbb->base);
diff --git a/crypto/bytestring/cbs.c b/crypto/bytestring/cbs.c
index bd94ccec..10f1a99b 100644
--- a/crypto/bytestring/cbs.c
+++ b/crypto/bytestring/cbs.c
@@ -52,10 +52,8 @@ size_t CBS_len(const CBS *cbs) {
}
int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) {
- if (*out_ptr != NULL) {
- OPENSSL_free(*out_ptr);
- *out_ptr = NULL;
- }
+ OPENSSL_free(*out_ptr);
+ *out_ptr = NULL;
*out_len = 0;
if (cbs->len == 0) {