From c282386fdb9d8944eaf2414ec817da936c4500cb Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 21 Jan 2021 18:29:44 +0300 Subject: [PATCH] [mod_pgsql] Fix memory leek in the case of an empty string of err_str in pgsql_handle_exec_base_detailed() --- src/mod/databases/mod_pgsql/mod_pgsql.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/databases/mod_pgsql/mod_pgsql.c b/src/mod/databases/mod_pgsql/mod_pgsql.c index e2efa5252c..f7c2983f91 100644 --- a/src/mod/databases/mod_pgsql/mod_pgsql.c +++ b/src/mod/databases/mod_pgsql/mod_pgsql.c @@ -515,6 +515,7 @@ error: err_str = pgsql_handle_get_error(handle); if (zstr(err_str)) { + switch_safe_free(err_str); if (!er) { err_str = strdup((char *)"SQL ERROR!"); } else {