diff options
author | jsing <> | 2020-09-26 14:43:17 +0000 |
---|---|---|
committer | jsing <> | 2020-09-26 14:43:17 +0000 |
commit | 5068512c1d5a02141d634c09f52dc97a6096a032 (patch) | |
tree | 3ab9fb4ff9a8215ce9b9bc92be9d1a9d42999a94 /src/lib/libssl/d1_both.c | |
parent | 9b13245446b00e24d00467fda708aec05a3ac606 (diff) | |
download | openbsd-5068512c1d5a02141d634c09f52dc97a6096a032.tar.gz openbsd-5068512c1d5a02141d634c09f52dc97a6096a032.tar.bz2 openbsd-5068512c1d5a02141d634c09f52dc97a6096a032.zip |
Call dtls1_hm_fragment_free() from dtls1_drain_fragments()
Currently dtls1_drain_fragments() has a incomplete handrolled version of
dtls1_hm_fragment_free(), which has the potential to leak memory. Replace
the handrolled free with a call to dtls1_hm_fragment_free().
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 6541a395a7..3d2516ce41 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_both.c,v 1.59 2020/09/26 08:58:00 jsing Exp $ */ | 1 | /* $OpenBSD: d1_both.c,v 1.60 2020/09/26 14:43:17 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -166,7 +166,7 @@ static int dtls1_write_message_header(const struct hm_header_st *msg_hdr, | |||
166 | static long dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, | 166 | static long dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, |
167 | int *ok); | 167 | int *ok); |
168 | 168 | ||
169 | static void dtls1_hm_fragment_free(hm_fragment *frag); | 169 | void dtls1_hm_fragment_free(hm_fragment *frag); |
170 | 170 | ||
171 | static hm_fragment * | 171 | static hm_fragment * |
172 | dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) | 172 | dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) |
@@ -195,7 +195,7 @@ dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) | |||
195 | return NULL; | 195 | return NULL; |
196 | } | 196 | } |
197 | 197 | ||
198 | static void | 198 | void |
199 | dtls1_hm_fragment_free(hm_fragment *frag) | 199 | dtls1_hm_fragment_free(hm_fragment *frag) |
200 | { | 200 | { |
201 | if (frag == NULL) | 201 | if (frag == NULL) |