diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 13e94a8baeb8ca65490b20e5dfdd470d1f489e6c..c32b78184489c90ef6b53a7f059d17f1ef1f7969 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -15208,6 +15208,7 @@ static int message_range_and_existence_check(struct vm_state *vms, const char *m
 				DISPOSE(vms->curdir, vms->curmsg);
 				break;
 			}
+			ast_config_destroy(msg_cfg);
 			DISPOSE(vms->curdir, vms->curmsg);
 		}
 		if (!found) {