diff options
author | jsing <> | 2014-05-28 13:03:25 +0000 |
---|---|---|
committer | jsing <> | 2014-05-28 13:03:25 +0000 |
commit | 1904ce01988b6ea0f5775507b4d812459c5b3f50 (patch) | |
tree | 60af46eb8cb0fcb0e51840739e416c98c124d73c /src/lib/libssl/d1_both.c | |
parent | 60cd1d60f58b32225afb881559d08dbc68a2eb79 (diff) | |
download | openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.gz openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.bz2 openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.zip |
There is no point in checking if a pointer is non-NULL before calling free,
since free already does this for us. Also remove some pointless NULL
assignments, where the result from malloc(3) is immediately assigned to the
same variable.
ok miod@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 0e32825695..59987bc1d8 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -200,8 +200,7 @@ dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) | |||
200 | if (reassembly) { | 200 | if (reassembly) { |
201 | bitmask = malloc(RSMBLY_BITMASK_SIZE(frag_len)); | 201 | bitmask = malloc(RSMBLY_BITMASK_SIZE(frag_len)); |
202 | if (bitmask == NULL) { | 202 | if (bitmask == NULL) { |
203 | if (buf != NULL) | 203 | free(buf); |
204 | free(buf); | ||
205 | free(frag); | 204 | free(frag); |
206 | return NULL; | 205 | return NULL; |
207 | } | 206 | } |
@@ -223,10 +222,8 @@ dtls1_hm_fragment_free(hm_fragment *frag) | |||
223 | EVP_MD_CTX_destroy( | 222 | EVP_MD_CTX_destroy( |
224 | frag->msg_header.saved_retransmit_state.write_hash); | 223 | frag->msg_header.saved_retransmit_state.write_hash); |
225 | } | 224 | } |
226 | if (frag->fragment) | 225 | free(frag->fragment); |
227 | free(frag->fragment); | 226 | free(frag->reassembly); |
228 | if (frag->reassembly) | ||
229 | free(frag->reassembly); | ||
230 | free(frag); | 227 | free(frag); |
231 | } | 228 | } |
232 | 229 | ||