This allows to free everything we allocated, so we can detect memory leaks. Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #2023
@@ -222,3 +222,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
return 0;
}
+
+void FuzzerCleanup(void)
+{
+}
@@ -33,3 +33,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
(void)ASN1_parse_dump(bio_out, buf, len, 0, 0);
@@ -94,3 +94,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
@@ -107,3 +107,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
@@ -36,3 +36,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
BIO_free(in);
@@ -38,3 +38,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
@@ -35,3 +35,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
@@ -40,3 +40,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
@@ -40,6 +40,8 @@ int main(int argc, char** argv)
FuzzerTestOneInput(buf, size);
free(buf);
+ FuzzerCleanup();
@@ -10,3 +10,4 @@
int FuzzerTestOneInput(const uint8_t *buf, size_t len);
int FuzzerInitialize(int *argc, char ***argv);
+void FuzzerCleanup(void);
@@ -250,3 +250,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
SSL_free(server);
+ SSL_CTX_free(ctx);
@@ -42,5 +42,8 @@ int main(int argc, char **argv) {
fclose(f);