From 1904ce01988b6ea0f5775507b4d812459c5b3f50 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 28 May 2014 13:03:25 +0000 Subject: 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@ --- src/lib/libssl/d1_both.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/d1_both.c') 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) if (reassembly) { bitmask = malloc(RSMBLY_BITMASK_SIZE(frag_len)); if (bitmask == NULL) { - if (buf != NULL) - free(buf); + free(buf); free(frag); return NULL; } @@ -223,10 +222,8 @@ dtls1_hm_fragment_free(hm_fragment *frag) EVP_MD_CTX_destroy( frag->msg_header.saved_retransmit_state.write_hash); } - if (frag->fragment) - free(frag->fragment); - if (frag->reassembly) - free(frag->reassembly); + free(frag->fragment); + free(frag->reassembly); free(frag); } -- cgit v1.2.3-55-g6feb