From 38f7641c93e363d8bcc8574ce4edf69350a88ab8 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Thu, 17 Jul 2008 15:45:25 +0000
Subject: [PATCH] Fix memory leak. (Closes issue #13096) Reported by
 gknispel_proformatique

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 res/res_config_sqlite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index c1ee895bfe..1dcf254e31 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -1091,6 +1091,7 @@ static struct ast_config *realtime_multi_handler(const char *database,
 
 	if (!(tmp_str = sqlite_mprintf("%s ORDER BY %q;", query, initfield))) {
 		ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+		sqlite_freemem(query);
 		ast_config_destroy(cfg);
 		ast_free(initfield);
 		return NULL;
-- 
GitLab