From 7b0d25daa33f39d49cecb7e4f26b16f89e23594e Mon Sep 17 00:00:00 2001
From: Ken Rice <krice@sipnavigator.com>
Date: Mon, 6 May 2019 11:19:58 -0500
Subject: [PATCH] FS-11830 memory leak in SWITCH_STANDARD_API(enum_function)

---
 src/mod/applications/mod_enum/mod_enum.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c
index 493e2c176a..3e458dd129 100644
--- a/src/mod/applications/mod_enum/mod_enum.c
+++ b/src/mod/applications/mod_enum/mod_enum.c
@@ -833,12 +833,14 @@ SWITCH_STANDARD_API(enum_function)
 		if (!strcasecmp(dest, "reload")) {
 			do_load();
 			stream->write_function(stream, "+OK ENUM Reloaded.\n");
+			switch_safe_free(mydata);
 			return SWITCH_STATUS_SUCCESS;
 
 		}
 
 		if (enum_lookup(root, dest, &results, NULL, session) != SWITCH_STATUS_SUCCESS) {
 			stream->write_function(stream, "No Match!\n");
+			switch_safe_free(mydata);
 			return SWITCH_STATUS_SUCCESS;
 		}